I am using SVG.js with the optional svg.draggable.js, extension and the basic implementation uses this code sample:
rect.draggable().on('beforedrag', (e) => {
e.preventDefault()
// no other events are bound
// drag was completely prevented
})
For my code I removed the e.preventDefault() and it is working as expected except that I am getting the following warning:
event.js:53 [Violation] Added non-passive event listener to a
scroll-blocking 'touchstart' event. Consider marking event handler
as 'passive' to make the page more responsive.
NOTE: the event I am calling is beforedrag
and warning occurs on touchstart
My code:
node.on('beforedrag', function(e) {
// stuff
})
Recommendations for this warning is to explicitly call option for passive (as referenced in this question), but because this is a different event passing a passive option (true or false) has no effect on the warning.
node.on('beforedrag', function(e) {
// stuff
}, null, { passive: false })
My updated question:
Is there anything that I can do to suppress this warning?
I will be opening an issue with the maintainer, but am more interested in what I can do instead of waiting for someone else to fix it.