App icon indicating copy to clipboard operation
App copied to clipboard

[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

Open mvtglobally opened this issue 4 years ago • 60 comments

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:

  1. Go to Chat > Emoji
  2. Search an non-existing emoji
  3. Press Enter
  4. 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

View all open jobs on GitHub

mvtglobally avatar Mar 24 '22 05:03 mvtglobally

Triggered auto assignment to @flaviadefaria (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

melvin-bot[bot] avatar Mar 24 '22 05:03 melvin-bot[bot]

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});
            }

sobitneupane avatar Mar 24 '22 11:03 sobitneupane

Triggered auto assignment to @Luke9389 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

melvin-bot[bot] avatar Mar 25 '22 09:03 melvin-bot[bot]

Triggered auto assignment to @jliexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

melvin-bot[bot] avatar Mar 25 '22 23:03 melvin-bot[bot]

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

jliexpensify avatar Mar 28 '22 01:03 jliexpensify

Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (Exported)

melvin-bot[bot] avatar Mar 28 '22 01:03 melvin-bot[bot]

Current assignee @Luke9389 is eligible for the Exported assigner, not assigning anyone new.

melvin-bot[bot] avatar Mar 28 '22 01:03 melvin-bot[bot]

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 avatar Mar 28 '22 08:03 Puneet-here

@Puneet-here
Sound goods. But on pressing enter focus should not be lost. Can you update your proposal?

Santhosh-Sellavel avatar Mar 28 '22 19:03 Santhosh-Sellavel

@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

Puneet-here avatar Apr 03 '22 16:04 Puneet-here

Will review this ASAP (today or by tomorrow).

Santhosh-Sellavel avatar Apr 07 '22 15:04 Santhosh-Sellavel

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?

Santhosh-Sellavel avatar Apr 07 '22 18:04 Santhosh-Sellavel

Bump @Puneet-here - can you review @Santhosh-Sellavel 's comment?

Also, re-assigning as I will be OOO for 2 weeks.

jliexpensify avatar Apr 14 '22 22:04 jliexpensify

Triggered auto assignment to @JmillsExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

melvin-bot[bot] avatar Apr 14 '22 22:04 melvin-bot[bot]

Jumping in for @jliexpensify while he's out. 🙌

JmillsExpensify avatar Apr 15 '22 16:04 JmillsExpensify

Let's double this @JmillsExpensify

cc: @Luke9389

Santhosh-Sellavel avatar Apr 18 '22 18:04 Santhosh-Sellavel

Proposals lack why this issue occurs (root cause), no follow-ups

Santhosh-Sellavel avatar Apr 18 '22 18:04 Santhosh-Sellavel

Project budget doubled to $500.

JmillsExpensify avatar Apr 18 '22 21:04 JmillsExpensify

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?

sobitneupane avatar Apr 20 '22 07:04 sobitneupane

#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.

Puneet-here avatar Apr 20 '22 12:04 Puneet-here