Answer the question
In order to leave comments, you need to log in
Vertical and horizontal scroll on iphone?
Hello. The problem is this: on a mobile device, there is no scroll on the site, because all the content is placed, which is what I need. I check from Android, everything is fine, but on iPhone, the customer sends me a video where he swipes up and down, while the side scroll does not appear. Again, there is no such thing on my device. On the other page, on the contrary, it does not swipe vertically, but it swipes horizontally. Nothing can go beyond the container, because I check in dev tools at all resolutions - there is no horizontal scroll. By the way, I asked him to go to the site from an iPhone through the Google Chrome browser, nothing swipes there, though on the other page the horizontal scroll still remains (I don’t have it). He says he checks with Iphone 11 pro.
Tried disabling touchmove like this:
function myFunction(x) {
if (x.matches) { // Если медиа запрос совпадает
document.body.addEventListener('touchmove', function (e) {
e.preventDefault();
});
}
}
let x = window.matchMedia("(max-width: 500px)")
myFunction(x)
x.addListener(myFunction);
Answer the question
In order to leave comments, you need to log in
body, html {
// Всё кроме сафари
overscroll-behavior: none;
// А это поможет в сафари, но только если контент не больше вьюпорта
touch-action: none;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question