Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Violation] output in chrome console #311

Open
Argun opened this issue Mar 11, 2019 · 2 comments
Open

[Violation] output in chrome console #311

Argun opened this issue Mar 11, 2019 · 2 comments

Comments

@Argun
Copy link

Argun commented Mar 11, 2019

[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.

@samirindiaittech
Copy link

samirindiaittech commented Apr 1, 2019

@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,

@codingforme
Copy link

codingforme commented Jul 10, 2019

@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) {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants