albertogasparin/Optiscroll

Cannot swipe on mobile Safari (iPad2)

henryruhs opened this issue · 6 comments

Hello,

there is a strange issue on mobile Safari. I cannot "swipe" the scrollable container by default, but after using one of the tracks the container can be scrolled using touch gestures.

It seems like something goes wrong with preventParentScroll, it maby is focusing the wrong container?

Best regards

Can you provide an example of this behavior? So I can debug it more easily.
However, I think that the problem is related to preventParentScroll with a non scrollable container.
Try adding the CSS tweaks for forcing the scrollbars and it should work as expected.

I tried the tweaks but did not found a optiscroll-prevent class. Do I have to add it manually?

No, the class is added automatically if the device is touch and preventParentScroll is true.

I will check this out tomorrow, thanks.

There is a naming issue in your dist files because the tweak is called optiscroll-nobounce and not optiscroll-prevent.

However it does not help to focus the right element. I can scroll another element 1px to 2px one time, maby this is the parent element? Are you sure this works on a iPad?

Just fixed it, the trick was to prevent event bubbling on the content element.

var contentElement = $('.pf-scrollbar-content');
contentElement.on('touchstart touchmove touchend', function (event) {
    event.stopPropagation();
});