fix: The links are focused and announced twice#79644
fix: The links are focused and announced twice#79644danieldoglas merged 7 commits intoExpensify:mainfrom
Conversation
|
@bernhardoj 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6cd826072
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| role={CONST.ROLE.LINK} | ||
| tabIndex={isSafari() ? 0 : -1} | ||
| accessibilityLabel={href} |
There was a problem hiding this comment.
Keep non-Safari keyboard focus for onPress-only links
When a link uses onPress without href, the inner Text doesn’t render an anchor, so the only focusable element is the PressableWithSecondaryInteraction. Setting tabIndex={-1} for non‑Safari removes it from the tab order, which means keyboard users on Chrome/Firefox can no longer tab to or activate these links at all. This is a regression for any custom-action links (no href) on non‑Safari browsers, and will also suppress screen reader focus/announcement for those users.
Useful? React with 👍 / 👎.
| onPressIn={onPressIn} | ||
| onPressOut={onPressOut} | ||
| role={CONST.ROLE.LINK} | ||
| tabIndex={isSafari() ? 0 : -1} |
There was a problem hiding this comment.
Hmm, why do we exclude safari?
There was a problem hiding this comment.
@bernhardoj On safari, the link is skipped if we pass tabIndex={-1} here. On safari, it works as expected on main.
There was a problem hiding this comment.
@nkdengineer I think we can set tabIndex to -1 on the Text instead?
But before going further, @Expensify/design may I get some opinions here? We have a <a> tag that is wrapped with a Pressable. Both <a> tag and Pressable are "tabbable", so this component is "tabbable" twice. (Our goal is to make it "tabbable" once only)
Except on Safari. On Safari, <a> tag is not "tabbable", but thanks to the Pressable, the link is still "tabbable". My question is, do we want to keep the Safari behavior, so that a link is not "tabbable"?
There was a problem hiding this comment.
My question is, do we want to keep the Safari behavior, so that a link is not "tabbable"?
I'm not sure I fully understand what do we mean by "keep the Safari behavior"? If we want it to be pressable once, then we should do what we can to ensure consistency cross platform. So we'd only do safari specific if Safari does something that goes against the cross-platform nature.
There was a problem hiding this comment.
@dubielzyk-expensify in Safari, <a> tag is not "tabbable", not navigatable by keyboard. In our app, we wrap the link with a Pressable, so it becomes "tabbable". Do we want to keep that behavior or change it so that it follows the Safari default behavior?
There was a problem hiding this comment.
We want the link to be clickable so I believe we want to keep it so that it's navigatable on safari as well 👍 (If I've still understood correctly 😅 )
There was a problem hiding this comment.
Okay, got it. Thanks! @nkdengineer can you try this instead?
I think we can set tabIndex to -1 on the Text instead?
OR
Keep setting the tabIndex to -1 on the Pressable and tabIndex 0 on the Text.
There was a problem hiding this comment.
@nkdengineer looks like setting tabIndex to -1 on the Text makes it unclickable with the keyboard. Let's use the second approach.
Keep setting the tabIndex to -1 on the Pressable and tabIndex 0 on the Text.
There was a problem hiding this comment.
@bernhardoj I updated and it works on safari.
Reviewer Checklist
Screenshots/VideosAndroid: mWeb Chromeandroid.mweb.mp4iOS: mWeb Safariios.mweb.mp4MacOS: Chrome / Safariweb.mp4 |
|
@nkdengineer please add a note in test step that it's for web/mweb only |
Done. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/danieldoglas in version: 9.3.7-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.7-3 🚀
|


Explanation of Change
fix: The links are focused and announced twice
Fixed Issues
$ #76922
PROPOSAL: #76922 (comment)
Tests (Web/mWeb only)
Prerequisite:
Offline tests
Same
QA Steps
Same as test
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: mWeb Chrome
Screen.Recording.2026-01-15.at.15.08.58.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2026-01-15.at.15.08.40.mov
MacOS: Chrome / Safari
Screen.Recording.2026-01-15.at.15.05.47.mov