marcelodolza / iziToast

Elegant, responsive, flexible and lightweight notification plugin with no dependencies.

Home Page:http://izitoast.marcelodolza.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Added no-passive event listener to a scroll-blocking 'touchstart'

camilosampedro opened this issue · comments

When I was running a test application on iPhone 6/7/8 mode in Chrome 74, I could show a toast message with no problems, but there was a warning in the console:

[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

This warning message was triggered on following line.

$DOM.toast.addEventListener('touchstart', function(e) {

As far as I understand it is not a big issue, I just wanted to let you know of this.

Hi, I tested this change and it seems to work.

$DOM.toast.addEventListener('touchstart', function (e) {
    drag.startMoving(this, that, settings, e);
}, { passive: true });

And this is another one:

$DOM.buttonClose.setAttribute('aria-label', 'Close');