mattbryson / TouchSwipe-Jquery-Plugin

TouchSwipe is a jquery plugin to be used with jQuery on touch input devices such as iPad, iPhone etc.
http://labs.rampinteractive.co.uk/touchSwipe/
Other
4.05k stars 1.68k forks source link

event.cancelable should be checked in touchEnd event handler #311

Closed gidabyte closed 6 years ago

gidabyte commented 7 years ago

In the touchEnd event handler, there is this part:

//call this on jq event so we are cross browser
if (options.preventDefaultEvents !== false) {
    jqEvent.preventDefault();
}

There should be an other check for jqEvent.cancelable, too, like this:

//call this on jq event so we are cross browser
if (options.preventDefaultEvents !== false && jqEvent.cancelable !== false) {
    jqEvent.preventDefault();
}

Without this check, there are several warning messages thrown in Chrome (latest version).

mattbryson commented 7 years ago

Ah, great. Could you make a pull request? I'll merge it in...

gidabyte commented 7 years ago

Sure, I've just added a pull request: https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/pull/312

Thanks

mattbryson commented 6 years ago

Closing as already merged. Cheers.