0

Scenario :
On iOS 12 none of solutions for iOS 11 doesn't work.

Tried CSS:

body.modal-open {
   overflow: hidden;
   position:fixed;
   width: 100%;
}

And also this

body.modal-open {
   touch-action: none;
}

Tried JS :

document.body.addEventListener('touchmove', function(e) {
   e.preventDefault();
});


Problem :

  • Is it possible to prevent body from scrolling on iOS 12?
Mf1Friend
  • 1
  • 1
  • 3

1 Answers1

-1

Take a look at this similar question but with plain javascript is answered at https://stackoverflow.com/a/49582193

document.addEventListener('touchmove', function(e) {
    e.preventDefault();
}, { passive: false });