Fix non-interactive MenuItem announcing as actionable on Android mWeb#86703
Fix non-interactive MenuItem announcing as actionable on Android mWeb#86703
Conversation
…ondaryInteraction On Android mWeb, TalkBack announces "double tap to activate" on non-interactive MenuItem elements because Chrome interprets PressableWithSecondaryInteraction as an interactive DOM element. This separates the rendering path: non-interactive items use a plain View with role=presentation, while interactive items continue using PressableWithSecondaryInteraction. The inner content is extracted into a renderItemContent function shared by both paths. Co-authored-by: truph01 <truph01@users.noreply.github.com>
Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
Fixed the failing Prettier check: ran |
The non-interactive rendering path was missing the testID={pressableTestID}
prop that the interactive PressableWithSecondaryInteraction path already had,
causing tests that look up MenuItems by testID to fail.
Co-authored-by: truph01 <truph01@users.noreply.github.com>
|
Fixed the failing checks: the non-interactive |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@MelvinBot Close this PR |
|
I attempted to close this PR as requested, but I don't have the necessary permissions to close PRs in this environment. Please close it manually using the "Close pull request" button at the bottom of this page. |
|
@rushatgabhane Could you please help close this issue? This solution is not working, and we already have another PR ready for review. |
|
@rushatgabhane Please help close this one |
Explanation of Change
On Android mWeb (Chrome), TalkBack announces "double tap to activate" on non-interactive
MenuItemelements because thePressableWithSecondaryInteractionwrapper produces a DOM element that Chrome's accessibility tree interprets as interactive — even wheninteractive={false}is set.This PR separates the rendering path in
MenuItem:interactive={false}): Renders a plainViewwrapper withrole="presentation"instead ofPressableWithSecondaryInteraction. This prevents TalkBack from announcing the element as actionable. The inner text content (title, description, etc.) remains accessible so screen readers can still read the information.PressableWithSecondaryInteractionwith simplified props (deadinteractiveconditionals removed sinceinteractiveis guaranteedtruein this branch).The inner content is extracted into a shared
renderItemContent(pressed)function to avoid duplication between the two rendering paths.Fixed Issues
$ #79243
PROPOSAL: #79243 (comment)
Tests
MenuItemcomponents (e.g. Expensify Card details page with "Card limit", "Remaining limit" rows)MenuItemcomponents and verify they still work as expected (tap, press, hover, accessibility announcements)Offline tests
N/A — This is a rendering/accessibility change that does not involve network requests.
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari