I fixed iOS Safari’s scroll lock bug with just CSS (and made a React package for it)

If you've ever tried to disable body scrolling in iOS Safari when a modal opens... you know the pain. Most workarounds involve JavaScript, touchmove event listeners, or weird side effects. I wanted something simpler — so I built react-ios-scroll-lock: a CSS-only scroll lock component that works across iOS, Android, and all major browsers. Why it’s different: ⚡️ Pure CSS – no JS scroll hacks

Apr 8, 2025 - 17:35
 0
I fixed iOS Safari’s scroll lock bug with just CSS (and made a React package for it)

If you've ever tried to disable body scrolling in iOS Safari when a modal opens... you know the pain.

Most workarounds involve JavaScript, touchmove event listeners, or weird side effects. I wanted something simpler — so I built react-ios-scroll-lock: a CSS-only scroll lock component that works across iOS, Android, and all major browsers.

Why it’s different:

⚡️ Pure CSS – no JS scroll hacks