Repository navigation
Fix disabled Next button not announced as disabled by screen readers - #81779
Conversation
Map the disabled prop to fullDisabled in WebGenericPressable so that disabled buttons receive the native HTML disabled attribute and aria-disabled on web, allowing screen readers to correctly announce the disabled state. Fixes Expensify#76908
|
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Testing this PR. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
trjExpensify
left a comment
There was a problem hiding this comment.
Accessibility project PR 👍
@mavrickdeveloper Please post screencasts of all the platforms. Same comment here too |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-accessibility-next.movAndroid: mWeb Chromemweb-chrome-accessibility.moviOS: HybridAppios-accessibility.moviOS: mWeb Safarimweb-safari-accessibility.movMacOS: Chrome / Safariweb-accessibility-next-2.movweb-accessibility-next-1.mov |
|
Waiting for full checklist with screencasts for all platform. |
|
@mavrickdeveloper Quick bump |
Later today, Will add the remaining screencasts to my open PRs |
|
@mananjadhav Mobile Screencasts added |
|
🚧 @inimaga has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/inimaga in version: 9.3.20-0 🚀
|
|
Issue is reproducible on macOS Sonoma 14.5 / Safari in Ad-hoc build. 81779_WEB-Repro.mp4 |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.20-6 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.20-6 🚀
|
Explanation of Change
Root Cause:
WebGenericPressable, thedisabledprop was only used for "soft-disable" (JS-level handler removal and visual styling) but was never propagated tofullDisabled, which controls the native HTMLdisabledattribute on the underlying<Pressable>.<button>element had nodisabledattribute and noaria-disabledattribute, so screen readers announced it as an active button: "Next, button".Solution:
disabledprop tofullDisabledinWebGenericPressableviafullDisabled={!!props.fullDisabled || !!props.disabled}.disabled={true}is passed, the underlying<button>receives the nativedisabledattribute andaria-disabled="true", allowing screen readers to correctly announce: "Next, disabled, button".index.tsx). The native implementation (index.native.tsx) andBaseGenericPressable.tsxare unchanged.Fixed Issues
$ #76908
PROPOSAL: #76908 (comment)
Tests
Prerequisites:
Primary Tests:
<button>hasdisabledandaria-disabled="true"attributesDisabled to Enabled Transition Tests:
disabledandaria-disabledattributes are removedKeyboard / Focus Tests:
document.querySelector('button[disabled]').focus()& verify focus does NOT move to the disabled buttonRegression Tests:
Offline tests
N/A , This fix only affects HTML attribute rendering on the web platform. Disabled state is determined by local component state (member selection), not network state.
QA Steps
Same as Primary Tests (steps 1–6) and Disabled , Enabled Transition Tests (steps 7–10).
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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-disabled2.mov
Android: mWeb Chrome
android-disabled2-mWeb.mov
iOS: Native
nativeScreen.Recording.2026-02-12.at.11.46.28.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-02-12.at.8.06.40.PM.mov
MacOS: Chrome / Safari
2026-02-07.08-03-48.mp4