Repository navigation
fix(android): don't override the child when MenuView is accessible or opens on long press - #1269
Merged
Merged
Conversation
… opens on long press Since #1190, MenuView makes every direct child clickable and focusable and replaces its click listener. When MenuView is itself accessible, TalkBack stops twice on the same element. In long press mode the replaced listener opens nothing, and the child's own onPress is lost. Leave the child alone in both cases, and make an accessible tap-to-open MenuView clickable so that it can still be opened from TalkBack. Fixes #1268 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #1268
Problem
Since #1190 (2.3.2),
MenuView.addViewmakes every direct child clickable and focusable and replaces its click listener. That causes two regressions:MenuViewis itself accessible, TalkBack stops on both it and the child. WithshouldOpenOnLongPress, the second stop does nothing.MenuViewis not accessible and opens on long press, the child's ownonPressno longer fires from an accessibility click.Change
MenuView.addViewleaves the child alone when theMenuViewis accessible or opens on long press.MenuViewis now clickable. Without this, leaving the child alone would leave nothing for TalkBack to activate.Verification
Sent
ACTION_CLICKto eachMenuViewand its child on an Android 16 emulator (RN 0.81, New Architecture):MenuViewonPressonPressonPressReal taps and long presses on these four setups open the menu only on the intended gesture.
assembleDebugpasses withnewArchEnabledtrue and false.Limitations
accessibleorshouldOpenOnLongPressafter mount does not undo an override already applied.🤖 Generated with Claude Code