Skip to content

fix: first-class onTap for PDFView (#133) - #353

Merged
endigo merged 1 commit into
migrate/kotlin-swiftfrom
wt/fix-gestures-133
Aug 3, 2026
Merged

fix: first-class onTap for PDFView (#133)#353
endigo merged 1 commit into
migrate/kotlin-swiftfrom
wt/fix-gestures-133

Conversation

@endigo

@endigo endigo commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a first-class PDFView.onTap callback delivered from native (Android OnTapListener, iOS single-tap recognizer) so apps get reliable taps without fighting the platform-view gesture arena.
  • Document that gestureRecognizers + TapGestureRecognizer is unreliable; prefer onTap. Keep gestureRecognizers for parent-scroll conflicts (EagerGestureRecognizer).
  • Example app shows a SnackBar on tap. Double-tap zoom and link handling remain intact (Android returns false from onTap so the event is not consumed).

Fixes #133

Test plan

  • flutter pub get && dart format . && flutter analyze && flutter test (95 passed)
  • Android unit tests (scripts/run_android_unit_tests.sh) — all passed
  • Manual: open example app → Open PDF → single-tap → SnackBar "PDF tapped (onTap)"
  • Manual: double-tap still zooms; links still open / hit onLinkHandler

Base: migrate/kotlin-swift (not main). No package version bump.

gestureRecognizers + TapGestureRecognizer is unreliable on platform views.
Report single taps from native AndroidPdfViewer / PDFKit via onTap instead.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b161ff6-07de-4516-8861-084c9ae8e9a6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

endigo pushed a commit that referenced this pull request Aug 3, 2026
First-class onTap callback for PDFView (#133) after merge of #353.
@endigo
endigo merged commit 3156257 into migrate/kotlin-swift Aug 3, 2026
1 check passed
@endigo

endigo commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

Review results (worker review-release-prs-353-357)

Quality gates

Check Result
flutter pub get
dart format .
flutter analyze ✅ No issues
flutter test ✅ 95 passed
Android unit tests ✅ BUILD SUCCESSFUL
dart pub publish --dry-run

Review notes

  • Native onTap on Android returns false so double-tap zoom and links keep working — correct.
  • iOS single-tap skips while isScrolling; cancelsTouchesInView = false so PDFKit links still work.
  • Docs correctly steer users away from unreliable TapGestureRecognizer on platform views.

Merge + release

Merged into migrate/kotlin-swift and published as 1.5.0-beta.3 on pub.dev.

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