Fix tooltip doesn't show after closing the emoji picker#33690
Fix tooltip doesn't show after closing the emoji picker#33690neil-marcellini merged 8 commits intoExpensify:mainfrom
Conversation
|
@aimane-chnaif Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@aimane-chnaif @neil-marcellini Our emoji picker PR caused this issue #33683. Explanation of the issue: App/src/components/Tooltip/PopoverAnchorTooltip.tsx Lines 11 to 23 in 573f6b7 The reason is that, when we close the popover, the App/src/components/PopoverProvider/index.tsx Lines 15 to 26 in 573f6b7 Why is it different? When we show the emoji picker, the popover provider will store the ref of the element. When we try to close the emoji picker, we immediately clear the ref, so App/src/components/EmojiPicker/EmojiPicker.js Lines 85 to 91 in 573f6b7 And because of that, App/src/components/PopoverWithoutOverlay/index.tsx Lines 55 to 59 in 573f6b7 So, local ref object !== emoji picker button ref object. I think we can consider this one as not a regression, but rather discovering a hidden bug. The real issue here is that we pass a different ref to In the previous code, when we show the emoji picker, the popover will store the ref as: And when we close the emoji picker, we pass Notice the ref value is already different, but it still works because the object reference is the same. The solution is to avoid the ref being updated before the popover is completely hidden. |
|
@bernhardoj There's seems to be a problem with your approach CurrentScreen.Recording.2023-12-30.at.11.15.24.AM.movThis PRScreen.Recording.2023-12-30.at.11.13.39.AM.movMine approach in #33683 (comment)Screen.Recording.2023-12-30.at.11.17.18.AM.movThis approach (i.e., the current logic for hiding the modal) was added to #7580. |
I strongly believe this is a regression, but its a easy to miss bug as you are not testing this behavior at all in the first place. (If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App) |
|
Thanks for catching that. I didn't realize I have pushed a new fix (which is still based on my previous fix because it fixes the root cause of the issue). |
|
@bernhardoj I believe you need to fix reassure test too |
|
@shubham1206agra it fails on |
|
@bernhardoj please also check if #33873 came from our PR. If so, let's fix it here. |
|
Checking |
|
Please also check if this performance regression came from our PR. Screen.Recording.2024-01-04.at.11.58.38.AM.mov |
|
Unrelated, already happens before the PR. |
|
@aimane-chnaif don't forget to check this one |
|
Thanks for catching that. I think I forgot to restest it after addressing this issue. The We can have a default props for it, but to be very safe, I think it's better to check whether the hide callback is not undefined before calling it. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2024-01-15.at.4.28.19.PM.movMacOS: Desktop |
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks good. Can we also included tests and QA for resizing, and upload a video of that before merging?
|
@neil-marcellini added |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 1.4.27-0 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.27-1 🚀
|

Details
Fixed Issues
$ #33683
$ #31155
PROPOSAL:
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Web/Desktop
Web/Desktop
Android/iOS/mWeb
No tooltip
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2023-12-28.at.13.41.40.mov
Screen.Recording.2024-01-17.at.11.38.44.mov
MacOS: Desktop
Screen.Recording.2023-12-28.at.13.42.04.mov
Screen.Recording.2024-01-17.at.11.37.14.mov