fix(render): specify the left coordinate in named destinations so internal links navigate in macOS Preview - #3460
Open
benbowler wants to merge 1 commit into
Conversation
…ernal links navigate in macOS Preview
🦋 Changeset detectedLatest commit: ee082a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This was referenced Jul 29, 2026
benbowler
marked this pull request as draft
July 30, 2026 10:36
benbowler
marked this pull request as ready for review
July 30, 2026 10:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3461.
setDestinationcurrently registers named destinations as/XYZ null <top> null. Apple's PDFKit (which powers Preview and any macOS/iOS app embeddingPDFView) discards the destination's top coordinate when the left coordinate is unspecified, and simply navigates to the top of the target page. On single-page documents this makes every internal<Link src="#id">appear completely dead.This PR passes the node's
box.left(falling back to 0) instead ofnull, producing/XYZ 0 <top> null: the same explicit form Acrobat writes. Verified with a headlessPDFViewharness: withnullleft the view does not move; with a specified left it scrolls to the exact destination. Chrome (PDFium), Firefox (pdf.js), Edge and Acrobat resolve both forms, so behaviour there is unchanged.Includes updated unit tests and a changeset.
Context: found while debugging Site Kit by Google (react-pdf powers its dashboard PDF export), where section links in the generated report worked in Chrome, Firefox, Edge and Acrobat but were dead in Apple Preview: google/site-kit-wp#13212. Site Kit currently ships this fix as a
patch-packagepatch (google/site-kit-wp#13225) and will drop it once a release containing this change is adopted.