[HOLD for payment 2022-06-02] [$500] If you search a non existing emoji and press enter, then after deleting the search term it won't fetch emojis again - reported by @Tushu17
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:
- Go to Chat > Emoji
- Search an non-existing emoji
- Press Enter
- Empty search box
Expected Result:
It should show emojis after clearing the search term.
Actual Result:
It shows 'No result found'
Workaround:
unknown
Platform:
Where is this issue occurring?
- Web
- Desktop App
Version Number: 1.1.44-4 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
https://user-images.githubusercontent.com/43995119/159847584-b358c6e3-ccd4-4f42-a26a-9f0afa0abf5b.mp4
Expensify/Expensify Issue URL: Issue reported by: @Tushu17 Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1647102086741009
Triggered auto assignment to @flaviadefaria (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Proposal: Addition of following line of code will solve the issue: https://github.com/Expensify/App/blob/6e9d429ad47044d71cb028fb14d5defc2de0af8a/src/components/EmojiPicker/EmojiPickerMenu/index.js#L152-L159
if (this.searchInput && !this.searchInput.isFocused()) {
this.setState({selectTextOnFocus: false});
this.searchInput.value = '';
this.searchInput.focus();
+ this.filterEmojis(this.searchInput.value);
// Re-enable selection on the searchInput
this.setState({selectTextOnFocus: true});
}
Triggered auto assignment to @Luke9389 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @jliexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Posted - I changed the title to fit in with Upwork's character limit, but kept the original title in this GH.
Internal - https://www.upwork.com/ab/applicants/1508261111247921152/job-details External - https://www.upwork.com/jobs/~01b2bf9b46c621dad9
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (Exported)
Current assignee @Luke9389 is eligible for the Exported assigner, not assigning anyone new.
Proposal
Need to remove this line https://github.com/Expensify/App/blob/b347866b2af95bd2c51eb6bb65098bd1d756e7d0/src/components/EmojiPicker/EmojiPickerMenu/index.js#L154
it will also solve one more problem. As of now when we press enter and type something the previous search term get's cleared instead it should stay and user should be able to modify it.
Before :-
https://user-images.githubusercontent.com/101883770/160362109-784e6c2c-c471-469b-b762-e713083b411d.mp4
Problem: if the user mistyped and presses enter then the user will just correct the typo but the search term is getting cleared so the user has to type the whole search term again which is not a good ux.
After removing the line 154:-
https://user-images.githubusercontent.com/101883770/160362103-54fac1da-7f60-44bf-9fcf-47dd345beec7.mp4
@Puneet-here
Sound goods. But on pressing enter focus should not be lost.
Can you update your proposal?
@Puneet-here Sound goods. But on pressing enter focus should not be lost. Can you update your proposal?
we can pass onBlur={() => this.searchInput.focus()} in composer
https://github.com/Expensify/App/blob/9a8291ba97c381b651b5344d6fa471c51ae70336/src/components/EmojiPicker/EmojiPickerMenu/index.js#L435-L439
Will review this ASAP (today or by tomorrow).
https://github.com/Expensify/App/issues/8287#issuecomment-1086899013 That does not make any sense. @Puneet-here Because it will not allow me to focus away from the search box.
Did you find out why the focus is lost first?
Bump @Puneet-here - can you review @Santhosh-Sellavel 's comment?
Also, re-assigning as I will be OOO for 2 weeks.
Triggered auto assignment to @JmillsExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Jumping in for @jliexpensify while he's out. 🙌
Let's double this @JmillsExpensify
cc: @Luke9389
Proposals lack why this issue occurs (root cause), no follow-ups
Project budget doubled to $500.
Proposal: Reason: Following lines of code change searchInput value to empty. https://github.com/Expensify/App/blob/6e9d429ad47044d71cb028fb14d5defc2de0af8a/src/components/EmojiPicker/EmojiPickerMenu/index.js#L152-L159
But It does not filterEmojis. So, I proposed following solution.
Proposal: Addition of following line of code will solve the issue:
https://github.com/Expensify/App/blob/6e9d429ad47044d71cb028fb14d5defc2de0af8a/src/components/EmojiPicker/EmojiPickerMenu/index.js#L152-L159
if (this.searchInput && !this.searchInput.isFocused()) { this.setState({selectTextOnFocus: false}); this.searchInput.value = ''; this.searchInput.focus(); + this.filterEmojis(this.searchInput.value); // Re-enable selection on the searchInput this.setState({selectTextOnFocus: true}); }
I might not be clear about the expected output. Is this the expected result?
#8287 (comment) That does not make any sense. @Puneet-here Because it will not allow me to focus away from the search box.
I don't think there's any problem in that. Can you tell why the user will try to take the focus away? I couldn't think of any practical reason. There will be only one case where the user will try to take the focus away from the search (when user wants to write something in the compose field but tapping anywhere on the screen closes the emoji picker so there's no problem in that)
I don't think there's any other simple way of keeping the text cursor in the search box, can you suggest any alternative way?
Did you find out why the focus is lost first?
As far as I know that's how inputs work, pressing enter on a field will take the focus away.