Reset emoji suggestion pop-up automatically after an emoji has been inserted#27711
Conversation
Reviewer Checklist
Screenshots/VideosWebchrome-desktop-2023-09-19_14.32.24.mp4Mobile Web - Chromeandroid-chrome.mp4Mobile Web - Safariios-safari-2023-09-19_14.48.44.mp4Desktopmac-desktop-2023-09-19_14.45.23.mp4iOSios-native-2023-09-19_15.40.26.mp4Androidandroid-native.mp4 |
| // Reset emoji suggestions when an emoji is replaced. | ||
| // Important when emoji is replaced and the selection is not changed, more info issue #27156 |
There was a problem hiding this comment.
| // Reset emoji suggestions when an emoji is replaced. | |
| // Important when emoji is replaced and the selection is not changed, more info issue #27156 | |
| // Ensure emoji suggestions are hidden even when the selection is not changed (so calculateEmojiSuggestion would not be called). |
I think we can make this comment a bit more concise.
| if (commentValue !== newComment) { | ||
| // Reset emoji suggestions when an emoji is replaced. | ||
| // Important when emoji is replaced and the selection is not changed, more info issue #27156 | ||
| if (suggestionsRef.current) { |
There was a problem hiding this comment.
I wonder if we should also have !_.isEmpty(emojis) as a condition here? I guess it's possible that in future newComment might not only be changed by emoji replacements, so might be worth future-proofing.
There was a problem hiding this comment.
I guess it's possible that in future newComment might not only be changed by emoji replacements
@jjcoffee
I agree about that, but I think !_.isEmpty(emojis) will not be useful in this case because emojis it returns all emoji in the text not only the current replaced emojis.
For example: text with emoji 😄👁️ then many lines of text then cursor at the end writing normal letters not emoji will return emojis = [😄, 👁️]
newComment now in the code refer to comment after replace emoji.
So I think If new replacement applied in the future, in this time the fix should be if (commentValueWithEmoji !== commentValueWithoutEmoji)
There was a problem hiding this comment.
@ahmedGaber93 Ah yes I see what you mean, that makes sense. Let's leave it for now then!
|
@ahmedGaber93 can you update the PR title to reflect the code changes in this PR? |
|
@MariaHCD Updated. |
|
@ahmedGaber93 I think your PR title should describe what the PR is doing instead of describing what it fixes. I updated the title, let me know if you think it should be different! |
|
🚀 Deployed to staging by https://github.com/MariaHCD in version: 1.3.72-1 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.72-11 🚀
|
|
🚀 Deployed to staging by https://github.com/MariaHCD in version: 1.3.74-0 🚀
|
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.74-3 🚀
|
Details
Fixed Issues
$ #27156
PROPOSAL: #27156 (comment)
Tests
Offline tests
N/A.
QA Steps
Same as Tests step.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Screen.Recording.2023-09-18.at.9.18.58.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-09-18.at.9.50.20.PM.mov
Mobile Web - Safari
Screen.Recording.2023-09-18.at.8.31.27.PM.mov
Desktop
Screen.Recording.2023-09-18.at.10.42.29.PM.mov
iOS
Screen.Recording.2023-09-18.at.8.29.11.PM.mov
Android
Screen.Recording.2023-09-18.at.10.15.58.PM.mov