question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.

See original GitHub issue

Hi 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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

3reactions
CrzLvlcommented, Feb 22, 2021

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.

1reaction
aloskacommented, Nov 16, 2020

Still not fixed?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found