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
[HOLD for payment 2025-01-18] [$250] Categories - Category list moves with up and down key when RHP Is opened #54587
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Version Number: v9.0.78-5 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team
Action Performed:
Go to staging.new.expensify.com
Go to workspace settings > Categories.
Open any category RHP.
Press keyboard up or down key.
Expected Result:
Category list will not move with up and down key when RHP is opened (as in PR #39327)
Actual Result:
Category list moves with up and down key when RHP is opened.
Please re-state the problem that we are trying to solve in this issue.
The categories list is scrollable with the arrow keys when the RHP is open.
What is the root cause of that problem?
In my testing, when using the arrow keys, the browser scrolls the last element the user interacted with. It's not well documented, but I found a Stack Overflow answer https://stackoverflow.com/a/77580408 mentioning this browser behavior.
When the RHP is not open, useArrowKeyFocusManager prevents the default behavior and controls the scrolling programmatically.
Edited by proposal-police: This proposal was edited at 2024-12-27 04:38:39 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Categories - Category list moves with up and down key when RHP Is opened
What is the root cause of that problem?
This issue stems from default web behavior. When a user clicks on content within a scrollable view, the browser allows scrolling via the keyboard's arrow keys.
The reason this issue does not appear on other pages as PR #39327, is that those screens use SectionList with useArrowKeyFocusManager to handle keydown events, and when the Category list is not focused this hook is not active
changed the title [-]Categories - Category list moves with up and down key when RHP Is opened[/-][+][$250] Categories - Category list moves with up and down key when RHP Is opened[/+]on Dec 31, 2024
changed the title [-][$250] Categories - Category list moves with up and down key when RHP Is opened[/-][+][HOLD for payment 2025-01-18] [$250] Categories - Category list moves with up and down key when RHP Is opened[/+]on Jan 11, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.83-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@jayeshmangwani@anmurali@jayeshmangwani 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] 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: N/A
[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.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon Dec 26, 2024
Triggered auto assignment to @anmurali (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.QichenZhu commentedon Dec 27, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The categories list is scrollable with the arrow keys when the RHP is open.
What is the root cause of that problem?
In my testing, when using the arrow keys, the browser scrolls the last element the user interacted with. It's not well documented, but I found a Stack Overflow answer https://stackoverflow.com/a/77580408 mentioning this browser behavior.
When the RHP is not open,
useArrowKeyFocusManagerprevents the default behavior and controls the scrolling programmatically.App/src/hooks/useArrowKeyFocusManager.ts
Line 110 in e94df0f
App/src/hooks/useKeyboardShortcut.ts
Line 34 in e94df0f
When the RHP is open,
useArrowKeyFocusManageris inactive, so the default behavior resumes.App/src/components/SelectionList/BaseSelectionList.tsx
Line 323 in e94df0f
What changes do you think we should make in order to solve the problem?
Always keep
useArrowKeyFocusManageractive. It will prevent the default behavior but do nothing else when the list is not focused.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
This issue is caused by the browser's default behavior, so I suggest manual testing in real browsers.
Also verity this change doesn't reintroduce #41906.
What alternative solutions did you explore? (Optional)
linhvovan29546 commentedon Dec 27, 2024
Edited by proposal-police: This proposal was edited at 2024-12-27 04:38:39 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Categories - Category list moves with up and down key when RHP Is opened
What is the root cause of that problem?
This issue stems from default web behavior. When a user clicks on content within a scrollable view, the browser allows scrolling via the keyboard's arrow keys.
The reason this issue does not appear on other pages as PR #39327, is that those screens use
SectionListwithuseArrowKeyFocusManagerto handle keydown events, and when the Category list is not focused this hook is not activeApp/src/components/SelectionList/BaseSelectionList.tsx
Lines 319 to 323 in e94df0f
What changes do you think we should make in order to solve the problem?
Disable scrolling when the Category list is not focused
App/src/components/SelectionList/BaseSelectionList.tsx
Lines 791 to 793 in e94df0f
POC
Screen.Recording.2024-12-27.at.11.18.13.AM.mov
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
Override arrow key behavior when RHP(CategorySettingsPage) is opened, we can add
useArrowKeyFocusManagerhook toCategorySettingsPagepageApp/src/pages/workspace/categories/CategorySettingsPage.tsx
Lines 38 to 43 in e94df0f
melvin-bot commentedon Dec 30, 2024
@anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Dec 31, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021874222072625755779
[-]Categories - Category list moves with up and down key when RHP Is opened[/-][+][$250] Categories - Category list moves with up and down key when RHP Is opened[/+]melvin-bot commentedon Dec 31, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jayeshmangwani (
External)17 remaining items
[-][$250] Categories - Category list moves with up and down key when RHP Is opened[/-][+][HOLD for payment 2025-01-18] [$250] Categories - Category list moves with up and down key when RHP Is opened[/+]melvin-bot commentedon Jan 11, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 11, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.83-5 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 2025-01-18. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 11, 2025
@jayeshmangwani @anmurali @jayeshmangwani 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]
jayeshmangwani commentedon Jan 19, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: Fix: navigate to invite list by arrow keys #42713 (comment)
[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: N/A
[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.
We already have the regression test for this PR: User can access the background list using the arrow keys while the RHP is open #39327 so there’s no need to create the same one.
melvin-bot commentedon Jan 20, 2025
@iwiznia, @anmurali, @jayeshmangwani, @QichenZhu Whoops! This issue is 2 days overdue. Let's get this updated quick!
anmurali commentedon Jan 22, 2025
Payment Summary
garrettmknight commentedon Feb 11, 2025
$250 approved for @jayeshmangwani