fix: move emoji suggestions to portals#24541
Conversation
|
@robertKozik 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] |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromeandroid-web.movMobile Web - SafariiOS.-.web.MP4Desktopdesktop.moviOSScreen.Recording.2023-08-17.at.10.41.05.movAndroidandroid.-.native.mov |
|
@allroundexperts I've found that AutoCompleteSuggestion is still hidden under, for this time not header but the Screen.Recording.2023-08-17.at.11.35.44.mov |
robertKozik
left a comment
There was a problem hiding this comment.
One small question to the code
@robertKozik I thought this was supposed to be tested on web only but I was incorrect it seems. Also, react portals aren't really on native, so I have to rethink this. |
|
dang, you're right about the browser thing. But if we can fix it on all platforms, it would be better to do so. Let me know what you think about squeezing in other platforms too |
Squeezing as an reducing the number of options to show depending on the height? |
|
no no, What are your thoughts on expanding the scope of this PR to include the native part as well? As I'm also open to stay with this as browser only, and treat the native as new issue then |
|
Right. We can make use of a library like https://github.com/gorhom/react-native-portal to make this work on both web and native. Do you think we should use it? |
|
Also, If we decide to use the above mentioned library, it would be better to migrate all of our |
|
Well, it seems like there's a completely different situation on the native side. I suggest we separate these two and prioritize pushing the web side of things forward. The native part is more complex and relatively uncommon. I'll proceed with review of this one |
|
On mWeb-safari I have encountered problems with the position of the suggestions view. @allroundexperts in order to trigger this behaviour you need to have screen keyboard on: Screen.Recording.2023-08-18.at.17.53.28.mov |
I will check this and get back. Thanks a lot for the heads up @robertKozik! |
|
@robertKozik Fixed. Screen.Recording.2023-08-19.at.3.34.22.AM.mov |
robertKozik
left a comment
There was a problem hiding this comment.
LGTM, lets push it forward 🚀
|
✋ 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/AndrewGable in version: 1.3.58-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.58-5 🚀
|
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 1.3.59-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.59-5 🚀
|
| return componentToRender; | ||
| } | ||
|
|
||
| return ReactDOM.createPortal(<View style={StyleUtils.getBaseAutoCompleteSuggestionContainerStyle({left, width, bottom})}>{componentToRender}</View>, document.querySelector('body')); |
There was a problem hiding this comment.
Not a huge deal, but I think we should strive to use the context-based @gorhom/portal instead of ReactDOM.createPortal wherever possible, to reduce unnecessary differences between code across platforms.
If we can keep our code in pure React Native (w/ react-native-web of course), we should
Details
This PR fixes the issue where on extremely small short height screens, the mention options were hidden behind the header.
In my original proposal, I proposed to remove
overflowHiddenstyle from the ReportActions container but upon further testing I found out that the proposed approach had another shortfall. Specifically, the report actions were not stacking behind the header correctly. As such, I decided to proceed with moving the menu inside React portals.Fixed Issues
$ #22930
PROPOSAL: #22930 (comment)
Tests
@in the composer and verify that the mention options are not hidden behind the report header.Offline tests
N/A
QA Steps
@in the composer and verify that the mention options are not hidden behind the report header.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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-08-14.at.6.52.20.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-08-14.at.6.58.47.PM.mov
Mobile Web - Safari
Screen.Recording.2023-08-14.at.6.58.14.PM.mov
Desktop
Screen.Recording.2023-08-14.at.6.54.44.PM.mov
iOS
Screen.Recording.2023-08-14.at.7.01.00.PM.mov
Android
Screen.Recording.2023-08-14.at.7.00.19.PM.mov