jQuery-slimScroll icon indicating copy to clipboard operation
jQuery-slimScroll copied to clipboard

[Violation] output in chrome console

Open Argun opened this issue 5 years ago • 2 comments

[Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

Chrome output above violation message after chrome v51, please refer this.

Argun avatar Mar 11 '19 08:03 Argun

@Argun have you got any solution yet for this?

have update slimscroll..js function attachwheel(target) with

function attachWheel(target) { if (window.addEventListener) { target.addEventListener('DOMMouseScroll', _onWheel, { capture: false, passive: false }); target.addEventListener('mousewheel', _onWheel, { capture: false, passive: false }); } else { document.attachEvent("onmousewheel", _onWheel) } }

still getting error in some places,

samirindiaittech avatar Apr 01 '19 09:04 samirindiaittech

@Argun have you got any solution yet for this?

have update slimscroll..js function attachwheel(target) with

function attachWheel(target) { if (window.addEventListener) { target.addEventListener('DOMMouseScroll', _onWheel, { capture: false, passive: false }); target.addEventListener('mousewheel', _onWheel, { capture: false, passive: false }); } else { document.attachEvent("onmousewheel", _onWheel) } }

still getting error in some places,

you can use the following code to distinguish whether the passive attribute is supported.

var supportsPassive = false;
try {
  var opts = Object.defineProperty({}, 'passive', {
    get: function() {
      supportsPassive = true;
    }
  });
  window.addEventListener("test", null, opts);
} catch (e) {}

codingforme avatar Jul 10 '19 03:07 codingforme