iziToast icon indicating copy to clipboard operation
iziToast copied to clipboard

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

Open camilosampedro opened this issue 5 years ago • 1 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. https://github.com/marcelodolza/iziToast/blob/7a63b735cb83df5c979b6799795986dcfa010aab/src/js/iziToast.js#L1250

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

camilosampedro avatar May 13 '19 03:05 camilosampedro

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');

eduard2014 avatar May 18 '19 12:05 eduard2014