ngryman / jquery.finger

:v: jQuery touch & gestures, fingers in the nose.
https://ngryman.sh/jquery.finger/
MIT License
423 stars 66 forks source link

Press event on scrollabars #42

Closed ghost closed 9 years ago

ghost commented 9 years ago

I have a problem with the press event in desktop browsers. When I scroll the div with overflow:auto using scrollbar (not a mouse wheel) press event is fired despite the cursor was actually moved.

Here is the example.

Environment: Chrome 44.0.2403.130 m, Windows 8.1.

ngryman commented 9 years ago

Hi, sorry for the late.

Nice catch! I won't fix this as it's really an edge case and an easy workaround can be done by ignoring the scrollbar in your css selector, something like this works in Chrome $('body:not(::-webkit-scrollbar)')on('...'). For other browsers you can read this.

If you want to generalize this to your whole application with something a little less verbose, you can create a custom selector. This would allow you to do something like this: $('body:no-scrollbars)')on('...'), assuming you created a no-scrollbar custom selector.