Preventing body scroll for modals in iOS
IOS does not respect overflow: hidden
set on body element, and allows for scrolling anyway, which sucks pretty bad when you have an open modal.
Most minimal solution is to set onTouchMove={e => e.preventDefault()}
on element that covers the whole screen.
Source and a more complex solution.
Thanks Dude and Krzysztof Golasik for working on this :)
Tweet