TouchSwipe-Jquery-Plugin
TouchSwipe-Jquery-Plugin copied to clipboard
Chrome Warning
Enable verbose output in the Chrome Inspector...
jquery.min.js:3 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
Chrome Version: Version 62.0.3202.62 (Official Build) (64-bit)
same issue, And seems to be normal page scroll is blocked with touchswipe enabled
I'm working on a new branch that totally re works the event model, and will hopefully sort these sort of issues. Will update the ticket as I go...
Exactly the same issue. Tap and DoubleTap are not working anymore.
"jquery-3.2.1.min.js:3 [Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952"
Any update on this? We need another version release push bad! Thanks for all the great work put into this.
**When I get some free time I'd like to contribute to improving the codebase.
Any update on this? +1
Anyone?
to suppress this warning you can...
addEventListener('touchstart', this.callPassedFuntion, { passive: false })
https://stackoverflow.com/questions/39152877/consider-marking-event-handler-as-passive-to-make-the-page-more-responsive
Even better?...
$(document).ready(function() {
document.addEventListener('touchstart', onTouchStart, {passive: true})
.../ the rest of your code..
})
https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners
https://github.com/mattbryson/TouchSwipe-Jquery-Plugin/pull/345
@knoxcard There are a few things to consider here.
TouchSwipe does not use passive listeners, it does need to call preventDefault()
during the touch move to stop the page scrolling inadvertently.
If you a swiping a carousel left / right, this prevents the page from moving slightly up and down as you do so.
I cant see anyway with chrome to flag the listener as active, or {passive:false} - it will always show that warning.
Also JQ doesn't support the new event options, so even if we did set it on all the bind / on calls it wouldn't make any difference.
If you did set it, your right, it would suppress the warning when the event is bound, but it would then error when the handler tries to call e.preventDefault
Ill try to get some time this week to finish off re working the event model that I started months ago :)
Sounds good, thanks @mattbryson