darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 497 forks source link

Browser console ! warning : Unable to preventDefault inside passive event listener due to target being treated as passive. #283

Open monecchi opened 7 years ago

monecchi commented 7 years ago

I'm not sure if this is a bug or not, so I'd really appreciate if anyone could tell me why my Sly init method is triggering the following browser console warning on touch/dragging:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.

Also should I be concerned about any lack of performance because of this issue?

Here's my sly initiation and options:

jQuery(function($) {
    'use strict';

var $frame  = $('#nav_menu');
var $slidee = $('#icon_nav_menu');
var $scrollbar = $('.scrollbar');

var sly = new Sly($frame, {
    slidee: $slidee,
    horizontal: true, 
    itemNav: 'basic',
    mouseDragging: 1, 
    dragging: 1,
    touchDragging: 1
    releaseSwing: 1,
    startAt: null, 
    scrollBar: $('.scrollbar'), 
    scrollBy: 1,
    scrollTrap: true,
    speed: 300,
    elasticBounds: 1,
    easing: 'linear', 
    dragHandle: 1, 
    dynamicHandle: 1
});

sly.on('load', function () {
    // check if there is nowhere to scroll
    if (sly.pos.start === sly.pos.end) {
        $scrollbar.hide();
    } else {
        $scrollbar.show();
    }
});

sly.init();

});
Hlsgs commented 7 years ago

See here.

thanooshan commented 4 years ago

I also got this error. After i put touch-action: manipulation; for the frame element, then issue was resolved.