-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HOLD for payment 2023-11-09] [HOLD for #24198] [$500] Pressing Enter on the state search page submits the form instead of only selecting the state. #26345
Comments
Triggered auto assignment to @sonialiap ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Pressing Enter on the state search page submits the form instead of only selecting the state. What is the root cause of that problem?The form submit button in the CompanyStep component is receiving key press events even when the StatePicker modal is visible. What changes do you think we should make in order to solve the problem?Add props to the StatePicker and AddressForm modules to handle show / hide events for the state picker modal, and then set the a flag using the state to indicate whether or not the form should be submitted. We should also do this for the RequestorStep page, forwarding the The solution can be achieved with the following steps:
What alternative solutions did you explore?We could also consider making the button disabled when the state picker is visible, but this will require updating the |
ProposalPlease re-state the problem that we are trying to solve in this issue.Pressing Enter on the state search page submits the form instead of only selecting the state What is the root cause of that problem?We have logic In this case, the search input is not belonged to form, it uses for search state App/src/components/FormSubmit/index.js Lines 14 to 38 in a644050
What alternative solutions did you explore?Update Lines 219 to 357 in 1b63c76
like this: dataSet: {formInputId: inputID}, Update App/src/components/TextInput/BaseTextInput.js Line 350 in 1b63c76
dataSet={{...props.dataSet, submitOnEnter: isMultiline && props.submitOnEnter}} Update App/src/components/AddressSearch/index.js Lines 301 to 343 in 1b63c76
Update submitForm function in App/src/components/FormSubmit/index.js Lines 14 to 38 in 1b63c76
like this ...
if (event.shiftKey || event.key !== CONST.KEYBOARD_SHORTCUTS.ENTER.shortcutKey || isEnterWhileComposition(event)) {
return;
}
if (!lodashGet(event, 'target.dataset.formInputId')) {
return;
}
... |
@sonialiap Huh... This is 4 days overdue. Who can take care of this? |
Triaging to external ⏭️ |
Job added to Upwork: https://www.upwork.com/jobs/~01bf4700c16d6a333f |
Current assignee @sonialiap is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
There should be listener what listens button actions. |
📣 @edward-potter818! 📣
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Pressing enter while in state selector submits the form rather than selecting the state of choice What is the root cause of that problem?The state select dropdown doesn't lock the proper focus when open so actions that should occur inside the focus context of the dropdown instead happen outside of it, as is default behavior for forms, but not very good by accessibility standards What changes do you think we should make in order to solve the problem?While some of the previously proposed solutions mentioned capturing the event and altering its logic to prevent the default behavior, I think it was being altered at the wrong level in the previous proposals in a way that was not as composable. There is already a component for capturing the focus of the arrow keys here:
Which is used by multiple selects to capture the focus of the arrow keys. This component can be extended to also capture the focus of the 'ENTER' key stroke and would fix this problem for not only this selection box, but any future selection boxes as well, making it a more extensible solution than previous proposals |
📣 @sicarius97! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
@sonialiap, @sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@sonialiap, @sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@sobitneupane what do you think of the existing proposal? |
Thanks for the proposal everyone.
@sicarius97 Can you please share more details on proposal. How are you planning to extend the component to manage ENTER key? |
@sonialiap, @sobitneupane Eep! 4 days overdue now. Issues have feelings too... |
On hold for #24198 |
Still on hold for #24198 That issue isn't super close to being resolved and I'll be OOO until Oct 22 so I'm going to update this issue to "weekly" for now. |
Still on hold for #24198 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-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 2023-11-09. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on 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:
|
This is Dupe. Resolved by #24198 |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
1-Go to settings -> workspaces -> your workspace -> add back 2- account -> connect manually.
3- Fill in the data.
4- Click on the "Connect" button.
5- Open the state search page.
6- Use the arrow keys to navigate to a state.
7- Press Enter.
Expected Result:
Pressing Enter should only select the state and return the user to the form.
Actual Result:
Pressing Enter selects the state and submits the form.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.59-1
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
Notes/Photos/Videos: Any additional supporting documentation
Screen.Recording.2023-08-21.at.2.52.27.PM.mov
Recording.1542.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ahmdshrif
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692629203062389
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: