-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[navigation-refactor] Fix animation glitch when navigating in the browser history with swiping iOS Safari #22678
Conversation
@fedirjh Are you bale to work on this one or should we reassign |
@mountiny Reviewing shortly. The linked issue is on hold for an upstream fix, so shouldn’t we open a similar upstream PR ? |
@fedirjh I think we can go ahead with this fix now and @adamgrzybowski will follow up with some upstream pr fix, the main priority is on the resize and performance issue now but after that we should get fix upstream, we dotn want to be maintaining patches |
@adamgrzybowski I run into this error when applying the patch : ![]() |
…h-for-swipe-ios-safari
Hey @fedirjh I fixed the patch |
Thank you @adamgrzybowski , reviewing shortly. |
Screenshots/VideosWebWeb.mp4Mobile Web - ChromeChrome.mp4Mobile Web - SafariSafari.mp4DesktopDesktop.mp4iOSIOS.mp4AndroidAndroid.mp4 |
@adamgrzybowski @mountiny Are we aware of this bug ? The header is updated after navigation , this is not related to this PR: Bug.mp4 |
I haven't seen any issue for that @fedirjh |
@fedirjh Is thi happening on main as well? then we can probably proceed. Do you think we can get through the checklist today? thanks! |
Yes it's on main as well. Will report it on slack.
Will do it shortly. |
Reviewer Checklist
|
@adamgrzybowski Looks like we are missing testing steps. |
@adamgrzybowski Found this bug when trying to swipe and the keyboard is open , the chat header jumps to the middle of the screen , on CleanShot.2023-07-25.at.01.34.36.mp4 |
…h-for-swipe-ios-safari
@fedirjh I merged the newest main and it works fine now. Thanks! |
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.
Looks good to me.
@adamgrzybowski Could you please add QA testing steps ? |
@fedirjh Done! |
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.
thanks everyone ❤️ 🚀
✋ 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/mountiny in version: 1.3.46-0 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.47-0 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.46-2 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.47-6 🚀
|
Details
Description of the problem
This is a patch for
react-navigation
to remove animation glitches on iOS Safari. These glitches occur when the user wants to navigate in the browser history with the swipe gesture. Quick and partial animation of the transition from the previous page is visible after swiping.To fix that we need to prevent transition animation for navigation done with gestures.
Solution
Gestures that would trigger navigation in the browser history generate broken touch events so this solution is based on this broken behavior. This will need a rework if the bugs with events in the iOS safari will be fixed.
This solution uses two different broken behaviors to detect if we should animate the transition.
pageX
value for thetouchend
event.touchend
event emitted.Edge case
There is one small use case where the animation will be prevented and it shouldn't be:
After one prevented transition animation this solution will work normally until the next case like that.
Video with the example below:
Screen.Recording.2023-07-11.at.21.24.33.mov
Follow up
We may want to contact
react-navigation
maintainers to see if they are interested in including this solution in their repository. It's hacky but it works. Also, there is a related issue on their GitHubNote
Those changes are relevant only for the iOS Safari version. They won't affect any other platform. But it's worth checking the Android web version.
Fixed Issues
$ #20886
Tests
Offline tests
QA Steps
Do these tests on iOS mobile
Test going back with swiping
Test going back with the back button
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Mobile Web - Chrome
Screen.Recording.2023-07-11.at.21.21.04.mov
Mobile Web - Safari
Screen.Recording.2023-07-11.at.20.57.55.mov
Desktop
iOS
Android