utsb-fmm / MobileLikeScroller

A verylight JS transforming your div into a swipable area with mobile-like inertia, enhancing the desktop scrolling experience.
MIT License
4 stars 1 forks source link

Don't work on mobile devices #1

Open AdemIssadWytopia opened 6 months ago

AdemIssadWytopia commented 6 months ago

This script is working well on my computer.

But when I open it on a mobile device, it's not working at all.

How to make it work with pointer events ?

samuelboudetfmm commented 6 months ago

I just open https://utsb-fmm.github.io/MobileLikeScroller/ with my mobile to check and it's working? Could you be more specific ? For pointer it is always a bit complicated to manage priority. The code is short do not hesitate to open it and modify for your needs.

AdemIssadWytopia commented 5 months ago

Indeed, it's working on your website. Can't figure why, it's working on pc website but when I load on my mobile, I can't make it work.

Also figured that : when using mozilla debugger as mobile device with touch event activated, scrolling is not working. It's like the touch event try to swipe instead of grabbing. when touch event is deactivated, the scroll work normally

EDIT : I found what was wrong : I was overriding the css overflow rule on my class, to hide the scrollbar, but that was breaking the scroll (only on mobile devices).

By the way, there is a fix to hide the scrollbar (was not working on mozilla) :

        .x-scroll:not(.with-scrollbar),.y-scroll:not(.with-scrollbar),.xy-scroll:not(.with-scrollbar) {
            scrollbar-width: none; 
        }

instead of scrollbar-width: 0;

Thanks