Non-passive event listener warning in Chrome console

When I add a CodeMirror instance to the page, I get this warning pair in Chrome’s 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

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

I am using React with a custom component to mount/unmount CodeMirror to the page. I don’t think that would be the issue, but the console chatter is certainly exacerbated when it happens frequently.

Is this something to be concerned with or that I can deal with?

Odd, I don’t see those when I load a page with CodeMirror in Chrome. But those handlers can be passive, so this patch makes them so.

1 Like