Fix can't open emoji picker when edit composer is focused#54858
Fix can't open emoji picker when edit composer is focused#54858techievivek merged 8 commits intoExpensify:mainfrom
Conversation
|
@DylanDylann 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] |
| if ( | ||
| relatedTargetId === CONST.COMPOSER.NATIVE_ID || | ||
| relatedTargetId === CONST.EMOJI_PICKER_BUTTON_NATIVE_ID || | ||
| EmojiPickerAction.isActive(action.reportActionID) |
There was a problem hiding this comment.
@bernhardoj Could you please explain this change? Is there any difference here? Thanks
There was a problem hiding this comment.
EmojiPickerAction.isEmojiPickerVisible() checks if a emoji picker is visible. EmojiPickerAction.isActive(action.reportActionID) checks if the emoji picker with an ID of action.reportActionID is visible. This way, we only prevent showing the main composer if the emoji picker is shown from the edit composer picker.
There was a problem hiding this comment.
@bernhardoj We have an inconsistency between IOS and Android that is caused by this change.
| Android and safari | IOS and mWeb in Android |
|---|---|
Screen.Recording.2025-01-13.at.16.33.04.mov |
400670619-eea2a373-6b79-4a38-b67b-c584cf1668b5.mp4 |
From my viewpoint, both behavior looks fine but we need to make it consistent (at least consistency on native and consistency on mWeb)
There was a problem hiding this comment.
Can you explain the inconsistency? The steps performed on the 1st video (android only) is different from the 2nd video (iOS only)
There was a problem hiding this comment.
Ahh sorry, I made a wrong video
There was a problem hiding this comment.
Ah, I see. From the video, you can see the chat behind the context menu is moving up which indicates the edit composer is blurred when showing the emoji picker and the main composer shows, but then it moves down again because the edit composer is somehow refocused.
I've tried commenting these codes
App/src/pages/home/report/ReportActionItemMessageEdit.tsx
Lines 194 to 203 in 3cf6037
even commenting the ref
App/src/pages/home/report/ReportActionItemMessageEdit.tsx
Lines 509 to 517 in 3cf6037
but the refocus still happens.
The composer is blurred when the emoji picker is shown because of this code.
App/src/components/Modal/BaseModal.tsx
Lines 75 to 78 in 3cf6037
saveFocusState blurs the current active input. I have commenting refocusAfterModalFullyClosed too, but still happens. I think it's a RN bug.
There was a problem hiding this comment.
@bernhardoj How about your second approach?
Second, we can refocus to the edit composer when the emoji picker from context menu hides, only if it's a small screen.
There was a problem hiding this comment.
For that approach, I was thinking that maybe we can use ReportActionComposeFocusManager.focus() and call it here.
(isActive) => {
setIsEmojiPickerActive(isActive);
if (!isActive) ReportActionComposeFocusManager.focus()
}
But I think that's like a workaround to hide the real issue. I think it's better to report it as a new issue and find someone to investigate why it happens like that on Android.
There was a problem hiding this comment.
@bernhardoj This is an additional bug and it is out of the scope of the original issue. And your solution can't solve this bug completely. So I suggest we should revert this change here and create a new issue to address this additional bug. If you agree, please test again on platforms after reverting
I can't reproduce this problem after applying the fix for the original bug |
|
Did you test it on web or native? It should happen on native without the EmojiPickerAction.isActive(action.reportActionID) update |
|
Ahh I see it |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-01-17.at.15.51.33.movAndroid: mWeb ChromeScreen.Recording.2025-01-17.at.15.07.38.moviOS: NativeScreen.Recording.2025-01-17.at.15.54.16.moviOS: mWeb SafariScreen.Recording.2025-01-17.at.15.07.01.movMacOS: Chrome / SafariScreen.Recording.2025-01-17.at.15.06.21.movMacOS: DesktopScreen.Recording.2025-01-17.at.15.08.13.mov |
|
✋ 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/techievivek in version: 9.0.87-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.0.87-3 🚀
|
Explanation of Change
Fixed Issues
$ #54599
PROPOSAL: #54599 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.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 and/or tagged@Expensify/designso 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.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4