Fix: Keyboard Navigation in Search Selects Incorrect Result#83878
Conversation
|
@dannymcclain @linhvovan29546 One of you needs to 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] |
JmillsExpensify
left a comment
There was a problem hiding this comment.
This makes sense to me. Selecting with the keyboard should take the top item, not what is hovered by a mouse. Product approved.
|
@codex review |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-04.at.10.25.13.movAndroid: mWeb ChromeScreen.Recording.2026-03-04.at.10.21.23.moviOS: HybridAppScreen.Recording.2026-03-04.at.10.30.53.moviOS: mWeb SafariScreen.Recording.2026-03-04.at.10.28.11.movMacOS: Chrome / SafariScreen.Recording.2026-03-04.at.10.18.22.mov |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
expected, we’re just removing some unnecessary code and tests |
| setHasKeyBeenPressed?.(); | ||
| setFocusedIndex((actualIndexParam) => { | ||
| const actualIndex = currentHoverIndexRef.current ?? actualIndexParam; | ||
| const actualIndex = actualIndexParam; |
There was a problem hiding this comment.
NAB we don't need to reassign this variable. Same for the instances below
|
🚧 @luacmartins 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! 🧪🧪
|
|
|
||
| const debouncedScrollToIndex = useDebounce(scrollToIndex, CONST.TIMING.LIST_SCROLLING_DEBOUNCE_TIME, {leading: true, trailing: true}); | ||
|
|
||
| const onArrowUpDownCallback = useCallback(() => { |
There was a problem hiding this comment.
No need manual memoization here. This component is React Compiler compliant.
This causes crash on main. useCallback is not imported in this file.
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.3.32-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.32-3 🚀
|
Explanation of Change
When a user is typing in search, keyboard navigation now prioritizes what the keyboard is doing, not where the mouse happens to be hovering.
Fixed Issues
$ #79395
PROPOSAL: #79395 (comment)
Tests
Offline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Screen.Recording.2026-02-13.at.7.13.16.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-02-13.at.7.15.53.PM.mov
iOS: Native
Screen.Recording.2026-02-13.at.7.19.44.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-02-13.at.7.22.29.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-02-13.at.4.24.57.PM.mov