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 2024-01-25] [$500] Workspace - Enter click does not trigger workspace remove members button #33201
Version Number: v1.4.11-6 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Open the app
Open settings
Open workspaces
Open any workspace
Open Members
Select any existing user and click on remove
Click enter on popup, observe that it does nothing
Click enter again and observe that it cancels the remove
Expected Result:
App should trigger remove button in popup on enter click as we do throughout the app for similar buttons
Actual Result:
App does not trigger remove button in popup for remove members on click of enter
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-] Workspace - Enter click does not trigger workspace remove members button[/-][+][$500] Workspace - Enter click does not trigger workspace remove members button[/+]on Dec 16, 2023
We have prop disableKeyboardShortcuts in SectionList, we just need to pass is true when modal is visible to enter key click is consumed by the button not the list item
When a modal is opened the active element changes to modal view, and activeElement.role is null
but since we are missing a null check, the shortcut is not disabled/
What changes do you think we should make in order to solve the problem?
Please re-state the problem that we are trying to solve in this issue.
Enter click does not trigger workspace remove members button
What is the root cause of that problem?
The root cause of the problem is that pressing enter after the modal is open will be listened by the BaseSelectionList so it deselects the selected item instead of pressing the Remove button in the modal. Basically we have got a proper disabling enter key logic in here
And we should focus on the remove button whenever the modal is rendered or focused (useEffect or useFocusEffect). These will solve similar problems where we use the confirm modal.
In ConfirmContent
What alternative solutions did you explore? (Optional)
In SelectionList we can create a new prop disableKeyboard and disable both arrow key and enter key shortcuts when the modal is open. So in WorkspaceMembersPage we can pass the prop depending on the state removeMembersConfirmModalVisible to disable keyboard on the SelectionList while the modal is open. I don't think it is proper that arrow keys are working for the list while the modal is open as it does now. We can also use this prop on other selection list instances where we want to disable the keyboard when modal is open.
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.26-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@amyevans] The PR that introduced the bug has been identified. Link to the PR:
[@amyevans] 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:
[@amyevans] A discussion in #expensify-bugs 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:
[@shubham1206agra / @ishpaul777] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@shubham1206agra] A discussion in #expensify-bugs 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: Not required
[@shubham1206agra] Determine if we should create a regression test for this bug. No
[@shubham1206agra] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@kevinksullivan] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Activity
[-] Workspace - Enter click does not trigger workspace remove members button[/-][+][$500] Workspace - Enter click does not trigger workspace remove members button[/+]melvin-bot commentedon Dec 16, 2023
Triggered auto assignment to @kevinksullivan (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Dec 16, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01fd33a43f9c145685
melvin-bot commentedon Dec 16, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Dec 16, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (
External)ishpaul777 commentedon Dec 16, 2023
Problem
Proposal
Workspace - Enter click does not trigger workspace remove members
Root Cause
When enter is triggered first time the sectionlist item is unselected because there is enter key listner still active on the page.
https://github.com/Expensify/App/blob/main/src/components/SelectionList/BaseSelectionList.js#L384
Changes
We have prop
disableKeyboardShortcutsin SectionList, we just need to pass is true when modal is visible to enter key click is consumed by the button not the list itemneonbhai commentedon Dec 16, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Enter click does not trigger workspace remove members button
What is the root cause of that problem?
This is because we don't disable the Keyboard Shortcut on BaseSelectionList when a modal is opened:
App/src/components/SelectionList/BaseSelectionList.js
Line 159 in 3ed43ff
When a modal is opened the active element changes to modal view, and
activeElement.roleisnullbut since we are missing a null check, the shortcut is not disabled/
What changes do you think we should make in order to solve the problem?
We should update the line here:
App/src/components/SelectionList/BaseSelectionList.js
Line 159 in 3ed43ff
to:
Result:
Screen.Recording.2023-12-16.at.9.27.42.PM.mov
neonbhai commentedon Dec 16, 2023
Proposal
Updated
Added video demostrating result of code changes.
FitseTLT commentedon Dec 16, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Enter click does not trigger workspace remove members button
What is the root cause of that problem?
The root cause of the problem is that pressing enter after the modal is open will be listened by the
BaseSelectionListso it deselects the selected item instead of pressing theRemovebutton in the modal. Basically we have got a proper disabling enter key logic in hereApp/src/components/SelectionList/BaseSelectionList.js
Lines 159 to 160 in 8bef4bb
which disables when the active element is checkbox or button and which is correct but in this case
Removebutton is not focused.What changes do you think we should make in order to solve the problem?
We should exploit the correct disabling enter shourtcut here
App/src/components/SelectionList/BaseSelectionList.js
Lines 159 to 160 in 8bef4bb
And we should focus on the remove button whenever the modal is rendered or focused (useEffect or useFocusEffect). These will solve similar problems where we use the confirm modal.
In
ConfirmContentWhat alternative solutions did you explore? (Optional)
In
SelectionListwe can create a new propdisableKeyboardand disable both arrow key and enter key shortcuts when the modal is open. So inWorkspaceMembersPagewe can pass the prop depending on the stateremoveMembersConfirmModalVisibleto disable keyboard on theSelectionListwhile the modal is open. I don't think it is proper that arrow keys are working for the list while the modal is open as it does now. We can also use this prop on other selection list instances where we want to disable the keyboard when modal is open.73 remaining items
melvin-bot commentedon Jan 18, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jan 18, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.26-2 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 2024-01-25. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jan 18, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
kevinksullivan commentedon Jan 24, 2024
@shubham1206agra mind finishing out the checklist above?
ishpaul777 commentedon Jan 25, 2024
Hey @kevinksullivan, Shumbam is OOO until 29th Jan. https://expensify.slack.com/archives/C02NK2DQWUX/p1706026202997839
shubham1206agra commentedon Feb 1, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
ishpaul777 commentedon Feb 2, 2024
@kevinksullivan friendly bump
melvin-bot commentedon Feb 6, 2024
@amyevans, @kevinksullivan, @shubham1206agra, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
kevinksullivan commentedon Feb 6, 2024
sorry for the delay, all set!