Skip to content

🔥 Fix iOS 15 Scroll Jank

Latest
Compare
Choose a tag to compare
@tannerhodges tannerhodges released this 27 Oct 01:19
0d214a0

Fixed

iOS 15 Safari's new address-bar-at-the-bottom triggers resize events way more often than previous versions, causing Snap Slider's update function to blow up any scroll that isn't perfectly horizontal (i.e., all scrolls).

This PR hotfixes the issue by replacing our window resize event handler with a ResizeObserver (in all major browsers—but not Internet Explorer, which gracefully ignores updates).

Now, instead of force-updating slider positions on every window resize event, we only update sliders when their container resizes (much better!).

For more details, see #22.

📺 Click here for before/after screencasts…

Before

2021-10-26.Snap.Slider.iOS.15.scroll.jank.mp4

After

2021-10-26.Snap.Slider.iOS.15.scroll.jank.fixed.mp4