[BUG] Violation warnings in verbose level chrome dev tools logging

Expected Behavior

Expect Chart.js to not cause logs in dev console

Current Behavior

touchstart and touchend event listeners log verbose level [Violation] messages (see below).

Possible Solution

addEventListener can now take a map {"passive": "true"} see the MDN entry

Steps to Reproduce (for bugs)

  1. Go to the unedited codepen: https://codepen.io/pen?template=JXVYzq
  2. Open chrome dev tools console and set log level to verbose
  3. Refresh page
  4. See verbose log in 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. Chart.bundle.min.js:14

Context

It’s helpful to have verbose logging turned on in development because chrome will warn you when javascript execution locks up the browser. Having Chart.js warnings comingled with application logs reduces signal to noise.

Environment

  • Chart.js version: tried in 2.0/2.5/2.6
  • Browser name and version: Chrome OSX Version 58.0.3029.110 (64-bit)

Author: Fantashit

1 thought on “[BUG] Violation warnings in verbose level chrome dev tools logging

Comments are closed.