lukehaas / Scrollify

A jQuery plugin that assists scrolling and snaps to sections.
MIT License
1.8k stars 580 forks source link

Problem with preventDefault on Chrome Version 73.0.3683.75 #372

Open mabrodeur opened 5 years ago

mabrodeur commented 5 years ago

Newest version of Chrome seems to disable the preventDefault on the wheel event due to the window now treated as passive.

You can see it on your example website. The scroll is now super glitchy and there are errors in the console : jquery-2.2.1.min.js:3 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/6662647093133312

I don't know if you if you can fix that? Basically it makes all the websites using your plugin on Chrome 73 not behaving correctly anymore.

Maybe using the scroll event instead of wheel might work?

Thanks!

timdk commented 5 years ago

Here is a quick fix: https://github.com/lukehaas/Scrollify/pull/374

It is probably worth refactoring all event listeners in this manner but this fixes the immediate problem.

ArboLife commented 4 years ago

I updated to Version 1.0.20 and added all the fixes I could find in #374. I still get hundreds of error in the Chrome console:

jquery.js:3 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/6662647093133312

I run on Wordpress 5.3.2 with the following code in the footer:

<script>
jQuery(document).ready(function($) {
  if( $('body.page-template-full-width').length ){ 
  // only load Scrollify on pages (not posts)

  if(!(/Android|webOS|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i.test(navigator.userAgent) )) { 
  // only load Scrollify on desktops
    $.scrollify({
        section : ".vc_row-o-full-height",
        sectionName : "section-name",
        interstitialSection : "#footer, #socket, .title-single",
        easing: "",
        scrollSpeed: 700,
        offset : 1,
        scrollbars: true,
        standardScrollElements: "",
        setHeights: true,
        overflowScroll: true,
        updateHash: false,
        touchScroll:true
      });
  }}
});
</script>