inuyaksa / jquery.nicescroll

nicescroll plugin for jquery - scrollbars like iphone/ipad
https://nicescroll.areaaperta.com/
3.6k stars 1.67k forks source link

Touch scrolling leads to a click event on Windows touch (Edge and Firefox browser) #614

Open jmlear opened 8 years ago

jmlear commented 8 years ago

When scrolling with the touch screen a click event is fired on the element that is being scrolling. This is not the behavior on an element that is just using the native browser scrolling.

This is an issue for me because I have clickable elements inside a div with nicescroll and they are being selected when just trying to scroll the div.

jmlear commented 7 years ago

@inuyaksa Is this fixed in version 3.7.5? I just tried 3.7.5 and I still see the issue. It's hard to tell what part of the commit was supposed to fix this issue. Can you share what you did to try to fix this issue? It's possible I am doing something on my side to negate your fix.

inuyaksa commented 7 years ago

Do you have a snippet code to test your issue? (I've reopened issue)

jmlear commented 7 years ago

You can test it here: https://jsfiddle.net/8wkg6ybg/

I am only seeing the issue on Windows Touch in Edge browser, but the touch scrolling is working properly when I remove nicescroll and simply use native scrolling.

inuyaksa commented 7 years ago

It seems related to bubbling. Coding in this form could resolve your issue:

$(document).on('click', '.selectable', function() {

In the meanwhile I'm trying a way to prevent bubbling.

jmlear commented 7 years ago

I tried attaching the listener as you described and that didn't seem to fix the issue. I was thinking that a click event shouldn't be fired on any element if you are scrolling the passage. If I change the demo to use native scrolling, no click event is triggered whenever I scroll the passage.

inuyaksa commented 7 years ago

Thanks, I'm investigating. Can you send me a screenshot of this page, I need more infos about your config: https://nicescroll.areaaperta.com/dojo2/browser.html

jmlear commented 7 years ago

Here is the screenshot from the device/browser I see the issue in. edge_screenshot