A
A
Alexey Karateev2020-08-26 11:22:36
safari
Alexey Karateev, 2020-08-26 11:22:36

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);


It did not help. Please tell me how this can be fixed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Marty McFly, 2020-08-26
@IVENTEYE

body, html {
    // Всё кроме сафари
    overscroll-behavior: none;
    // А это поможет в сафари, но только если контент не больше вьюпорта
    touch-action: none;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question