You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-05-07] [$250] Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly. #87379
Version Number: 9.3.54-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@dmkt9 Slack conversation (hyperlinked to channel name): #Open Source
Action Performed:
Prerequisite: The user has several reports.
Open the application in a web browser
Navigate to Reports > Reports
Use the up/down arrow keys to navigate focus
Expected Result:
When at the top or bottom of the list, pressing the up or down arrow key should immediately focus the item at the opposite end of the list.
Actual Result:
The up/down arrow keys must be pressed multiple times before the focus returns to the top or bottom of the list.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
In BaseSearchList, the useArrowKeyFocusManager hook is initialized with maxIndex: flattenedItemsLength - 1 (BaseSearchList/index.tsx:51). flattenedItemsLength is the total count of individual transactions across all report groups, computed in SearchList/index.tsx:225-233. However, the FlashList only renders data.length items (the report group rows, not individual transactions).
This creates a mismatch: the arrow key focus manager cycles through indices 0 to flattenedItemsLength - 1, but only indices 0 to data.length - 1 correspond to rendered items. When focus wraps (e.g., pressing ArrowDown past the last visible item), it traverses all the "ghost" indices one key press at a time — none of which match any rendered item — before reaching a visible item at the opposite end.
For example, 5 report groups containing 20 total transactions means maxIndex = 19 but only indices 0–4 are visible. Pressing ArrowDown at index 4 requires 16 presses (4→5→6→…→19→0) to wrap back to the top.
What changes do you think we should make in order to solve the problem?
Change maxIndex in BaseSearchList/index.tsx:51 from flattenedItemsLength - 1 to data.length - 1 for the arrow key focus manager, so that keyboard navigation only cycles through actually rendered list items.
flattenedItemsLength should continue to be used where it's needed for select-all/checkbox counting logic, but it should not govern keyboard navigation bounds.
What alternative solutions did you explore? (Optional)
An alternative would be to pass disabledIndexes to useArrowKeyFocusManager for all indices >= data.length, but this is unnecessarily complex when simply correcting maxIndex achieves the same result more cleanly.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
changed the title [-]Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly.[/-][+][$250] Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly.[/+]on Apr 8, 2026
The keyboard focus manager in the search reports list uses a maxIndex derived from flattenedItemsLength, but the list that actually receives focus is rendered from data. In grouped report views, flattenedItemsLength can be much larger than data.length (for example, group rows vs. all child transactions), so arrow navigation steps through non-rendered indexes before it wraps. That is why users need multiple up/down presses before focus appears again at the opposite end.
⚠️@abbasifaizan70 Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.
📣 @hamza-nafasat! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
changed the title [-][$250] Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly.[/-][+][Due for payment 2026-05-07] [$250] Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly.[/+]on Apr 30, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ZhenjaHorbach The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Open the application in a web browser
Navigate to Reports > Reports (ensure the user has several reports)
Use the Down arrow key to move focus through the list
When focus reaches the last item, press Down once more
Activity
MelvinBot commentedon Apr 8, 2026
Proposal
What is the root cause of that problem?
In
BaseSearchList, theuseArrowKeyFocusManagerhook is initialized withmaxIndex: flattenedItemsLength - 1(BaseSearchList/index.tsx:51).flattenedItemsLengthis the total count of individual transactions across all report groups, computed inSearchList/index.tsx:225-233. However, the FlashList only rendersdata.lengthitems (the report group rows, not individual transactions).This creates a mismatch: the arrow key focus manager cycles through indices 0 to
flattenedItemsLength - 1, but only indices 0 todata.length - 1correspond to rendered items. When focus wraps (e.g., pressing ArrowDown past the last visible item), it traverses all the "ghost" indices one key press at a time — none of which match any rendered item — before reaching a visible item at the opposite end.For example, 5 report groups containing 20 total transactions means
maxIndex = 19but only indices 0–4 are visible. Pressing ArrowDown at index 4 requires 16 presses (4→5→6→…→19→0) to wrap back to the top.What changes do you think we should make in order to solve the problem?
Change
maxIndexinBaseSearchList/index.tsx:51fromflattenedItemsLength - 1todata.length - 1for the arrow key focus manager, so that keyboard navigation only cycles through actually rendered list items.flattenedItemsLengthshould continue to be used where it's needed for select-all/checkbox counting logic, but it should not govern keyboard navigation bounds.What alternative solutions did you explore? (Optional)
An alternative would be to pass
disabledIndexestouseArrowKeyFocusManagerfor all indices >=data.length, but this is unnecessarily complex when simply correctingmaxIndexachieves the same result more cleanly.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.melvin-bot commentedon Apr 8, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (
External)melvin-bot commentedon Apr 8, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022041863440172893172
[-]Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly.[/-][+][$250] Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly.[/+]abbasifaizan70 commentedon Apr 8, 2026
Proposal
What is the root cause of that problem?
The keyboard focus manager in the search reports list uses a
maxIndexderived fromflattenedItemsLength, but the list that actually receives focus is rendered fromdata. In grouped report views,flattenedItemsLengthcan be much larger thandata.length(for example, group rows vs. all child transactions), so arrow navigation steps through non-rendered indexes before it wraps. That is why users need multiple up/down presses before focus appears again at the opposite end.App/src/components/Search/SearchList/index.tsx
Lines 225 to 233 in 24db80a
App/src/components/Search/SearchList/index.tsx
Lines 526 to 537 in 24db80a
App/src/components/Search/SearchList/BaseSearchList/index.tsx
Lines 49 to 53 in 24db80a
What changes do you think we should make in order to solve the problem?
App/src/components/Search/SearchList/index.tsx
Lines 526 to 537 in 24db80a
App/src/components/Search/SearchList/BaseSearchList/types.ts
Line 34 in 24db80a
App/src/components/Search/SearchList/BaseSearchList/index.tsx
Lines 49 to 53 in 24db80a
github-actions commentedon Apr 8, 2026
abbasifaizan70 commentedon Apr 8, 2026
@ZhenjaHorbach, I added the proposal after the
ExternalandHelp wantedlabels. Please take this while reviewing proposals. Thankshamza-nafasat commentedon Apr 8, 2026
Proposal
Problem
Arrow key navigation requires multiple presses to wrap focus from the last item to the first (and vice versa) in Reports > Reports.
Root Cause
The focus manager (
useArrowKeyFocusManager) is usingflattenedItemsLengthasmaxIndex, while the UI only rendersdata.lengthitems.This creates a mismatch:
Result:
Focus traverses non-rendered “virtual” indices before reaching a valid item.
Solution
Decouple focusable item count from flattened data count.
Implementation
BaseSearchList:flattenedItemsLengthunchanged for selection/count logic.Why this approach
Validation
melvin-bot commentedon Apr 8, 2026
📣 @hamza-nafasat! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
65 remaining items
[-][$250] Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly.[/-][+][Due for payment 2026-05-07] [$250] Up/Down arrow keys on the Reports > Reports page do not focus the top/bottom items correctly.[/+]melvin-bot commentedon Apr 30, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 30, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-05-07. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 30, 2026
@ZhenjaHorbach The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
melvin-bot commentedon May 4, 2026
@ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon May 6, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)ZhenjaHorbach commentedon May 7, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: https://github.com/Expensify/App/pull/68455/changes#r3200463967
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-598e-ad67-d97c-9aeb0df4ad24mallenexpensify commentedon May 7, 2026
Payment Summary
Contributor: @MobileMage paid $250 via Upwork
Contributor+: @ZhenjaHorbach due $250 via NewDot
^ Test case created
Thx
garrettmknight commentedon May 10, 2026
$250 approved for @ZhenjaHorbach