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
🧘 Doesn’t interfere with touch or scroll events
📱 Works on iOS, Android, and desktop
🪶 Minimal performance cost
🧩 Easy to plug into any React project
Demo:
👉 Live demo here (just open the menu)
How it works:
I wrote a detailed post on the technique and the problem it solves here:
📝 Medium Post