I used to use the following code to prevent web page from scrolling on touch devices (specifically tested on iOS).
disableScroll = false;
$(document).on('touchmove',function(e) {
if (disableScroll) {
e.preventDefault();
}
});
However since iOS 11 this no longer works. Using iOS Simulator I can go back and test on iOS 9 and iOS 10 and it works fine but no longer on iOS11. Can anyone suggest an alternative solution?
For example, testing this similar functionality on iOS 9/10 works but doesn't on iOS 11. https://benfrain.com/preventing-body-scroll-for-modals-in-ios/