-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$1000] ESC key focuses the input field in emoji picker before closing it #18559
Comments
Triggered auto assignment to @michaelhaxhiu ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.We want to prevent the search field getting focused in emoji picker when its already not focused and escape is pressed. What is the root cause of that problem?We are focusing the search input here as a default condition App/src/components/EmojiPicker/EmojiPickerMenu/index.js Lines 182 to 184 in ab9171f
What changes do you think we should make in order to solve the problem?We should prevent the input getting focused when escape is pressed (and its already not focused) by adding an additional condition if (this.searchInput && !this.searchInput.isFocused() && keyBoardEvent.key !== 'Escape') {
this.setState({selectTextOnFocus: false});
this.searchInput.focus();
// Re-enable selection on the searchInput
this.setState({selectTextOnFocus: true});
} What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.ESC key focuses the input field in emoji picker before closing it What is the root cause of that problem?We allow typing in the search box if any key is pressed. But we don't prevent some special keys like command, esc, option, control,... App/src/components/EmojiPicker/EmojiPickerMenu/index.js Lines 181 to 190 in ab9171f
What changes do you think we should make in order to solve the problem?We should check if the pressed key is a special key (length > 1) or a key is pressed in combination with Meta, Control, Alt. we will prevent focusing the input like this
What alternative solutions did you explore? (Optional) |
Triggered auto assignment to @kadiealexander ( |
Re-assigning because I'm headed OOO this week (starting this evening) and need to clear my plate. |
Reproduced on the desktop web app: 2023-05-09_18-18-29.mp4 |
Job added to Upwork: https://www.upwork.com/jobs/~01cd478505a855a06d |
Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Triggered auto assignment to @techievivek ( |
PROPOSAL |
📣 @qsstudioprince! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Pressing the ESC key in the Emoji menu (when search bar is not focused) focuses the search bar before closing. What is the root cause of that problem?The final if statement in keyDownHandler, triggers the search input to focus as the if statement only checks if search input is not focused. What changes do you think we should make in order to solve the problem?When the ESC key is pressed, it should simply execute the default behaviour and close the menu without having to execute any of the actions inside keyDownHandler. What alternative solutions did you explore? (Optional)I explored the other proposals mentioned above which works as well. However, I feel there is no need to go through all the if statements if ESC is pressed. |
I am not sure about the expected behaviour, so I will ask about it on Slack after completing other tasks. |
I'm very sure this is introduced with a recent merge since at the time of reporting, it was only present in staging and not in production. I mentioned it in the bug report too but I think that was missed by the OP while creating issue. Can also be seen in the video attached in bug report by me |
Thanks for pointing that out! Before moving forward, we will have to find the PR that caused this (to prevent introducing any regressions) |
@thesahindia This PR causes this bug. App/src/components/EmojiPicker/EmojiPickerMenu/index.js Lines 181 to 190 in ab9171f
--> this bug doesn't happen Now: After This PR is merged, we only subscribe ESC key when App/src/components/EmojiPicker/EmojiPickerMenu/index.js Lines 181 to 190 in ab9171f
|
So IMO, the RCA is we don't prevent subscribing the special key in the emoji search input (It's unnecessary) In the main composer, we also don't focus if a key is pressed in combination with Meta, Control or Alt or If the key pressed is non-character keys like Enter, Shift (see this PR) |
I am not sure if this is worth fixing because it seems to close the emoji picker just fine. |
@techievivek Could you see my proposal? I think we still should prevent focus to search input when the user type Enter, Esc, Cmd, Shift Key,... or a key is pressed in combination with Meta, Control or Alt like in the main composer in this PR |
I'm not sure if this is the right reason to close the issue since its FOCUSING search composer when user intends to CLOSE the picker which is quite contradictory in itself. Also, that brief flash doesn't look user friendly at all and lastly, its a something we did not intend and is found in regression |
@techievivek I just created new bug on Slack to catch this bug |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected results:
should close the emoji picker
Actual results:
re-focuses the search field before closing it
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.11.2
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
bandicam.2023-05-06.21-36-37-911.mp4
Recording.521.mp4
Expensify/Expensify Issue URL:
Issue reported by: @chiragxarora
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683389168956379
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: