foqer / perfect-scrollbar

MIT License
0 stars 0 forks source link

Invert horizontal scroll to vertical #1

Open GabbereX opened 1 year ago

GabbereX commented 1 year ago

"perfect-scrollbar": "^1.5.5"

const ps = new PerfectScrollbar('.container', { suppressScrollY: true })

`.ps { position: relative overflow: hidden !important; overflow-anchor: none; -ms-overflow-style: none; //touch-action: auto; //-ms-touch-action: auto; touch-action: none; }

/*

}`

Everything works fine on desktop. But on devices with a touchpad, a problem occurs. While touch-action: auto; -ms-touch-action: auto;

I get an error when trying to vertical swipe: [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted. touchMove @ touch.js:169

and the slider shift does not work, it moves back and forth quite a bit

When I property none touch-action: none;

in this case, the slider fires inversely, horizontal scrolling works when scrolling vertically. I don't understand how to solve this problem, please help.

GabbereX commented 1 year ago

It looks like a bug. I went to the source code and found the place responsible for the scrollbar movement. Function mouseMoveHandler replaced "e[pageY] = e.touches[0].pageY" on "e[pageY] = e.touches[0][pageY]". It seems to be working fine now Until I realized that this is a bug, where it came from. Searching for alternatives and all that took 10 hours :) Maybe this is the wrong fix, but it looks like that was the problem.