-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle login scroll on virtual viewport #42603
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add some comments to explain the intent of this callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and tested well!
✋ 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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