-
Notifications
You must be signed in to change notification settings - Fork 340
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
Doesn't work with Safari CSS Scroll Snap #157
Comments
I did not set |
Strange hack, but it works: disabling the scroll-snap before scrolling, then re-enabling and also calling scrollIntoView(). Also, I don't know why it's necessary to set scrollSnapType on both 'body' and 'html' (I only have it on in the css file), but I couldn't get it to work with only one setting.
|
On Mac, Safari version 14.0.3. smoothscroll works fine with scroll snap at least for element. I'm not sure which version @riccardolardi is talking about as latest, but I'd assume it's version 13.x.x. However, I still had this issue with iOS Safari version 15.3.1. After updating to 15.4.1. today, the issue disappeared. I tried to apply @MarkVasile workaround because of this issue on iOS. However it did not work for me for safari 14.0.3. The symptom was that after timeout, the scroll would snap to the beginning of the container element, which obviously is bad. I tried some fixes like disabling scroll by setting overflow: hidden or setting the scroll position again after adjusting scrollSnapType to mandatory but that was glitchy and unreliable. Moral of the story: if you've used this workaround, it might be a good idea to either stop using it or checking for Safari version numbers and only applying it to some range of versions. I'm not sure how you'd go about figuring out the exact version range to apply the fix, though... |
Breaks in latest Safari if
html
orbody
element is set toscroll-snap-type: y mandatory;
The text was updated successfully, but these errors were encountered: