Skip to content

fix(reader): stop PDF overlay toggle glitches on iPadOS 18 - #963

Merged
everpcpc merged 2 commits into
mainfrom
fix/pdf-reader-overlay-glitches
Aug 23, 2026
Merged

fix(reader): stop PDF overlay toggle glitches on iPadOS 18#963
everpcpc merged 2 commits into
mainfrom
fix/pdf-reader-overlay-glitches

Conversation

@everpcpc

Copy link
Copy Markdown
Owner

Summary

Fixes two native PDF reader issues reported on iPadOS 18 (also observable on iOS 26 for the tap issue): #956 (page content shifts vertically whenever the controls overlay is shown or hidden) and #957 (slow/short drag gestures incorrectly toggle the controls overlay).

Changes

Both changes are in PdfDocumentView_iOS:

  • Native PDF Reader: content moves on tap (iPadOS 18) #956 — vertical content shift. Toggling the overlay also toggles the status bar (.statusBarHidden(!shouldShowControls)), which changes safe-area insets; PDFView's internal scroll views use .automatic content-inset adjustment, so the rendered page shifts vertically. All internal scroll views are now locked to .never, re-applied after every presentation configuration change because usePageViewController(_:) rebuilds PDFView's internal hierarchy.
  • Tap to show navigation in native PDF reader recats to slow/short drag gestures as well #957 — accidental drags toggle the overlay. UITapGestureRecognizer's built-in movement slop lets slow/short drags through as taps. The coordinator now records the touch-down location and timestamp and rejects recognized "taps" that moved more than 10 pt or lasted longer than 0.5 s, so incidental contact while reading no longer pops the overlays.

Validation

  • make build-ios / make build-macos / make build-tvos all pass.
  • Behavior change is iOS-only; macOS uses a separate PdfDocumentView and is untouched. Not verified on a physical iPadOS 18 device — feedback from the reporter on the next build would confirm.

Two native PDF reader fixes:

- Lock PDFView internal scroll views to contentInsetAdjustmentBehavior
  .never, re-applied after every presentation configuration change since
  usePageViewController rebuilds the hierarchy. The status bar toggling
  with the controls overlay otherwise shifts the page vertically through
  .automatic inset adjustment on iOS 18 (issue #956).
- Reject single taps that moved more than 10pt or lasted over 0.5s, so
  slow/short accidental drags no longer toggle the reader overlays
  (issue #957).
@everpcpc
everpcpc marked this pull request as ready for review August 22, 2026 14:33
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@everpcpc
everpcpc merged commit 78d3f63 into main Aug 23, 2026
3 checks passed
@everpcpc
everpcpc deleted the fix/pdf-reader-overlay-glitches branch August 23, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant