Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Unable to preventDefault inside passive event listener invocation.' Console Error When Hooking into Lifecycle Methods #474

Open
dmaroso-movi opened this issue Feb 16, 2024 · 0 comments

Comments

@dmaroso-movi
Copy link

dmaroso-movi commented Feb 16, 2024

When hooking into any of the available onDestroy(), onDestroyStarted(), etc. An Unable to preventDefault inside passive event listener invocation. is thrown in the console. If my reading is correct this is because the code is calling preventDefault() on incoming events which is causing this error to be thrown when the event is passive.

Potential Fixes Ive found:

  • Filter out the passive events in the onDriverClick() function call
  • Add { passive: false } to the event listener responsible for firing onDriverClick()
  • Note I am seeing this an Angular 12 project so it might be and angular interaction issue. I currently have a workaround by removing the buttons' css classes and manually adding event listeners which call moveNext() etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant