[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.
See original GitHub issueHi there!
In your example “SVG Inserted with Embed Element” if you switch to console in development tools of chrome (version 73 or newer) you will receive the following error in console:
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.
Expected behaviour
this error should not appear in console
Configuration
- svg-pan-zoom version:
v3.6.0
- Browser(s):
google chrome 79.0
- Operating system(s):
OSX
- A relevant example URL: http://ariutta.github.io/svg-pan-zoom/demo/embed.html
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Easy fix for: Unable to preventDefault inside passive event ...
1. Remove the need for preventDefault() in the event listener ... The correct way to fix this issue is by finding the event...
Read more >Unable to preventDefault inside passive event listener
This is a helpful article to understand the problem: developer.chrome.com/blog/scrolling-intervention Quoting: "impacted pages are fixed relatively easily by ...
Read more >[Chrome] Unable to preventDefault inside passive event ...
The fix is simply to force the listeners to be active for those elements. So replacing this. jquery.nicescroll/jquery.nicescroll.js. Line 2555 ...
Read more >Unable to preventDefault inside passive event listener - Edureka
But I am getting this error: Unable to preventDefault inside passive event listener due to the target being treated as passive.
Read more >Unable to preventDefault inside passive event listener ...
Unable to preventDefault inside passive event listener invocation. ... This may be a plugin or theme conflict. Please attempt to disable all plugins,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Replace lines 1580 and 1592 of the unminified code:
1580. elem[ _addEventListener ]( prefix + eventName, cb, useCapture || false );
1592. elem[ _removeEventListener ]( prefix + eventName, cb, useCapture || false );
…with:
elem[ _addEventListener ]( prefix + eventName, cb, useCapture || { capture: false, passive: false } );
elem[ _removeEventListener ]( prefix + eventName, cb, useCapture || { capture: false, passive: false } );
This solution was adapted from here, which offers an explanation as to what this does and why it works. I haven’t thoroughly tested it but it seems to resolve the console errors and allows the SVG to be zoomed without scrolling the page.
Still not fixed?