A scroll, wheel or touch listener calls preventDefault
The message
MARKLESS_GLOBAL_EVENT_PASSIVE_PREVENT: <attributeName> calls event.preventDefault(), but a "<type>" listener on the document or window is passive, so the browser ignores the call.
Browsers treat touchstart, touchmove and wheel listeners on the document and window as passive so scrolling never waits for code, and a scroll event cannot be cancelled at all.
Put the handler on the element that scrolls or is touched, with an ordinary on* prop, or use the CSS touch-action or overscroll-behavior property.
https://markless.dev/errors/MARKLESS_GLOBAL_EVENT_PASSIVE_PREVENTWords in angle brackets change from case to case.
Why
Browsers treat touch and wheel listeners on the document and window as passive, so scrolling never waits for code, and a scroll event cannot be cancelled at all. Markless listens for these passively too, so the call would do nothing.
Fix
Put the handler on the element that scrolls or is touched, as an ordinary onWheel or onTouchMove prop, or stop the scroll with the CSS touch-action or overscroll-behavior property.
<div class="canvas" onWheel={(event) => { event.preventDefault(); zoom(event.deltaY); }}/>Related
Where Markless raises it
Button sounds are from Josh Comeau's Button Sounds library.