Skip to content

fix(android): don't override the child when MenuView is accessible or opens on long press - #1269

Merged
Naturalclar merged 1 commit into
masterfrom
fix/android-accessible-menu-child
Nov 29, 2026
Merged

Naturalclar merged 1 commit into
masterfrom
fix/android-accessible-menu-child

Conversation

@Naturalclar

Copy link
Copy Markdown
Member

Fixes #1268

Problem

Since #1190 (2.3.2), MenuView.addView makes every direct child clickable and focusable and replaces its click listener. That causes two regressions:

  • When the MenuView is itself accessible, TalkBack stops on both it and the child. With shouldOpenOnLongPress, the second stop does nothing.
  • When the MenuView is not accessible and opens on long press, the child's own onPress no longer fires from an accessibility click.

Change

  • MenuView.addView leaves the child alone when the MenuView is accessible or opens on long press.
  • An accessible tap-to-open MenuView is now clickable. Without this, leaving the child alone would leave nothing for TalkBack to activate.

Verification

Sent ACTION_CLICK to each MenuView and its child on an Android 16 emulator (RN 0.81, New Architecture):

MenuView Before #1190 2.3.4 This PR
accessible, tap nothing opens two stops, only the child opens it one stop, opens the menu
accessible, long press one stop two stops, the second is dead one stop
not accessible, tap child onPress opens the menu opens the menu
not accessible, long press child onPress nothing child onPress

Real taps and long presses on these four setups open the menu only on the intended gesture. assembleDebug passes with newArchEnabled true and false.

Limitations

  • Not tested with TalkBack itself, and behavior was not exercised on the old architecture.
  • The child is handled when it is added, so changing accessible or shouldOpenOnLongPress after mount does not undo an override already applied.
  • An accessible long-press menu still can't be opened with an accessibility click.

🤖 Generated with Claude Code

… 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>
@Naturalclar
Naturalclar merged commit 43f2a77 into master Nov 29, 2026
6 checks passed
@Naturalclar
Naturalclar deleted the fix/android-accessible-menu-child branch November 29, 2026 04:19
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.

Android: #1190 makes the child a second, dead TalkBack stop when MenuView is itself accessible

1 participant