handle login scroll on virtual viewport#42603
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: NativeN/A. The changes of this PR only applies to mobile Webkit browser. Android: mWeb ChromeN/A. The changes of this PR only applies to mobile Webkit browser. iOS: Native0-ios.mp4iOS: mWeb Safari0-mobile-safari.mp4iOS: mWeb Chromeios-mobile-chrome.mp4MacOS: Chrome / SafariN/A. The changes of this PR only applies to mobile Webkit browser. MacOS: DesktopN/A. The changes of this PR only applies to mobile Webkit browser. |
|
@suneox Android is not working Screen.Recording.2024-05-27.at.1.03.48.AM.mov |
…on-virtual-viewport
|
@eh2077 Could you please share your tested device? I just double-check, and it doesn't happen on native device due to this issue happen on mobile web due to virtual viewport auto trigger scroll the input to safe area view Screen.Recording.2024-05-28.at.00.14.09.mov |
|
@suneox I'm using |
I'll check asap |
@madmax330 cc: @eh2077 |
|
Did this PR introduce this behavior or is it already this was for those older devices? |
@madmax330 Scroll behavior native & mWebRPReplay_Final1717321998.MP4 |
|
@suneox Is it possible to follow Platform-Specific File Extensions to avoid introduce the regression? |
@eh2077 I have update condition |
@suneox So the regression on Android native App is fixed right? I haven't tested your latest changes because my laptop has trouble to build the App. |
@eh2077 I don't think we have regression on android native due to the scroll behavior only happens on mWeb, and it raises overlap issue, currently this PR is fix for mWeb. |
| const submitContainerRef = useRef<View | HTMLDivElement>(null); | ||
| const handleFocus = useCallback(() => { | ||
| if (!Browser.isMobileWebKit()) { | ||
| return; | ||
| } | ||
| InteractionManager.runAfterInteractions(() => { | ||
| htmlDivElementRef(submitContainerRef).current?.scrollIntoView?.({behavior: 'smooth', block: 'end'}); | ||
| }); | ||
| }, []); |
There was a problem hiding this comment.
Can you please add some comments to explain the intent of this callback?
There was a problem hiding this comment.
I have updated explanation for this change
|
I'm still working on preparing recordings |
|
@suneox I got following error when testing mobile Safari It seems the App use some regex expression which is not support in mobile Webkit. Did you face similar issue? I used physical iPhone 12 Pro Max with iOS 16.1.1 |
I haven't got this issue, i think it is not related to regex Screenshots/VideosiOS: mWeb ChromeRPReplay_Final1716566467.MP4Android: NativeScreen.Recording.2024-05-24.at.22.52.20.movAndroid: mWeb ChromeScreen.Recording.2024-05-24.at.22.51.01.moviOS: NativeScreen.Recording.2024-05-24.at.22.52.36.moviOS: mWeb SafariScreen.Recording.2024-05-24.at.22.49.33.movMacOS: Chrome / SafariScreen.Recording.2024-05-24.at.23.07.44.movMacOS: DesktopScreen.Recording.2024-05-24.at.22.53.59.movI have double-check a current regex on both function const isMobileSafari: IsMobileSafari = () => {
const userAgent = navigator.userAgent;
return /iP(ad|od|hone)/i.test(userAgent) && /WebKit/i.test(userAgent) && !/(CriOS|FxiOS|OPiOS|mercury)/i.test(userAgent);
};
const isMobileWebKit: IsMobileWebKit = () => {
const userAgent = navigator.userAgent;
return /iP(ad|od|hone)/i.test(userAgent) && /WebKit/i.test(userAgent);
}; |
|
@suneox I tried restarting but still same error. I'm curious what's your iOS version? I found that |
@eh2077 I use iOS 17. A difference between |
|
I see, changes of this PR should be fine. Let me try switching to main and see what happens. Update: I got same error on the main branch with Let me try upgrade iOS to 17 then Update: It works after upgraded to iOS 17 I reported this issue here on slack. |
|
✋ 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/madmax330 in version: 1.4.82-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.82-4 🚀
|


Details
Fixed Issues
$ #41108
PROPOSAL: #41108 (comment)
Tests
Precondition: install chrome on ios device
Offline tests
QA Steps
Precondition: install chrome on ios device
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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
iOS: mWeb Chrome
RPReplay_Final1716566467.MP4
Android: Native
Screen.Recording.2024-05-24.at.22.52.20.mov
Android: mWeb Chrome
Screen.Recording.2024-05-24.at.22.51.01.mov
iOS: Native
Screen.Recording.2024-05-24.at.22.52.36.mov
iOS: mWeb Safari
Screen.Recording.2024-05-24.at.22.49.33.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-24.at.23.07.44.mov
MacOS: Desktop
Screen.Recording.2024-05-24.at.22.53.59.mov