Repository navigation
fix(ios26): let a tap reach the child of the native context menu - #191
Open
itsatifsiddiqui wants to merge 1 commit into
Open
itsatifsiddiqui wants to merge 1 commit into
itsatifsiddiqui wants to merge 1 commit into
Conversation
The transparent platform view sat above the child in hit testing, so its arena member joined first and won every plain tap at the sweep. Hit test the child first while still painting the platform view on top, so a tap goes to the child and a long press still opens the native menu.
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.
Description
On iOS 26+ a plain tap on a tappable child of
AdaptiveContextMenu(for example aGestureDetectorwithonTap) never fired. The transparentUiKitViewsat above the child in hit testing, so its gesture arena member joined first and won every tap at the arena sweep. Long press and the native menu are unchanged, iOS 18 and Android are unchanged.Type of Change
Related Issues
Follow-up to #161
Changes Made
ios26_context_menu.dart: a smallStacksubclass still paints the platform view on top, but hit tests the child first and then always the platform view. The child's tap joins the arena first and wins, the platform view is told to drop that touch (the same path as when a scroll wins), and a long press still wins early and opens the native menu with the lifted preview.test/ios26_context_menu_test.dart: a tap reaches the child, a double tap on a parent still wins, and a long press goes to the platform view. The tap test fails without the fix.Arena log before the fix, tapping a
GestureDetectorinside the menu on an iOS 26 simulator:Testing
Automated Tests⚠️ REQUIRED
flutter test)flutter analyze)dart format)Manual Testing
AdaptiveContextMenuopens it, long press opens the native menu, double tap and scrolling still workChecklist
Breaking Changes
None