Repository navigation
Add keyboard navigation support for autocomplete result rows - #82500
arosiclair merged 5 commits into
Conversation
The row Pressable elements in react-native-google-places-autocomplete
lacked tabIndex, making them unreachable via Tab key. When tabbing from
the text input, focus left the container, triggering onBlur which hid
the list before selection could occur. This patch adds tabIndex={0},
accessible, and an onKeyDown handler (Enter/Space) to make rows
keyboard-focusable and selectable.
Fixes Expensify#79621
|
|
|
@MobileMage I can still reproduce it: Screen.Recording.2026-02-19.at.13.17.36.movAm I doing something wrong? can you reproduce it? Thank you. |
|
@MobileMage what is the status here? You've been very unresponsive on this issue. Let's finish this ASAP or you will unassigned |
|
The fix works when you use space in step 7 but not when you use enter. |
…moving double-fire
|
Fixed now, take a look @brunovjk Kapture.2026-02-24.at.19.18.42.mp4 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-02-26.at.13.07.58.mov |
brunovjk
left a comment
There was a problem hiding this comment.
Now it looks good. @MobileMage @arosiclair should we include in the testing steps that this PR is only for Web Chrome/Safari? Thank you.
Updated it |
|
🚧 @arosiclair 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! 🧪🧪
|
|
✋ 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/arosiclair in version: 9.3.27-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.27-8 🚀
|
Explanation of Change
The
react-native-google-places-autocompletelibrary's rowPressableelements were not keyboard-focusable (missingtabIndex). When a user tabbed from the text input in the Track Distance waypoint flow, focus would leave the autocomplete container entirely. This triggered theonBlurhandler inAddressSearch, which checks if the blur target is still inside the container viaisCurrentTargetInsideContainer. Since the rows couldn't receive focus, the check returnedfalse, hiding the suggestion list before any selection could occur.This patch adds
tabIndex={0},accessible, and anonKeyDownhandler (for Enter and Space) to the rowPressablein the library. This makes the rows keyboard-focusable, so when tabbing from the input, focus moves to a row inside the container,isCurrentTargetInsideContainerreturnstrue, and the list stays visible for selection.Fixed Issues
$ #79621
PROPOSAL: #79621 (comment)
Tests
Offline tests
N/A - This change only affects keyboard focus behavior on autocomplete UI elements. The underlying network requests and offline handling are unchanged.
QA Steps
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
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
79621.mp4