fix(ios): block screen touches while header UIMenu is open#4193
Open
jasleenkaur-qed42 wants to merge 1 commit into
Open
fix(ios): block screen touches while header UIMenu is open#4193jasleenkaur-qed42 wants to merge 1 commit into
jasleenkaur-qed42 wants to merge 1 commit into
Conversation
When a native stack header menu is presented, taps outside the menu were reaching RN Pressables underneath. Hook menu presentation via a deferred menu element, disable content interaction on the stack, and restore it on dismiss or item selection. Fixes software-mansion#4139
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.
Summary
UIMenuis openProblem
On iOS, when using
unstable_headerRightItemswithtype: 'menu', taps on screen content (e.g.Pressable) still fired while the menu was open. Native apps block those touches.Solution
RNSBarButtonItem: wrap menu children inUIDeferredMenuElementand invoke amenuPresentedcallback before the menu appears (dispatched on main queue)RNSScreenStackHeaderConfig: wire callback toRNSScreenStackViewRNSScreenStack: while menu is open, disable top screen content interaction and install a one-shot gesture recognizer to intercept outside-dismiss taps before Fabric's touch handlerTest plan
rn-screens-menu-repro)