suppress some chrome violation warnings#16547
suppress some chrome violation warnings#16547wkpark wants to merge 1 commit intoAUTOMATIC1111:devfrom
Conversation
…rnings e.g.) [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive
There was a problem hiding this comment.
I'm not a web dev so I'm not going to pretend that I know what are chrome violation warnings and passive event listener
all I can say is that
based on the console logs I see this when I use scrool wheel to change brush size
zoom.js?1729383118.4002457:810 Unable to preventDefault inside passive event listener invocation.
targetElement.addEventListener.passive @ zoom.js?1729383118.4002457:810
for my limited knowledge this prevents suppressing default functions of the action like they scroll wheel when changing brush size or right click context menu on gen button
vase on the doc you linked
passive
A boolean value that, if true, indicates that the function specified by listener will never call preventDefault(). If a passive listener calls preventDefault(), nothing will happen and a console warning may be generated.
so I'm not sure why you would want to use this as we explicitly uses preventDefault() in that event

Description
{passive: true}option theaddEventListener()to suppress chrome violation warnings.See also: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#passive
Checklist: