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

flag touchstart event handlers as passive: false #46

Open
dannywieser opened this issue Aug 9, 2018 · 1 comment
Open

flag touchstart event handlers as passive: false #46

dannywieser opened this issue Aug 9, 2018 · 1 comment

Comments

@dannywieser
Copy link

Not a critical issue, but when the svg.select.js library is used in an app, chrome outputs several warnings to the console when an SVG element is selected:

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

Taking a look at the code it appears that the different touchstart events in the code always trigger preventDefault, so it seems that all of the touchstart events in the library could be flagged as passive: false to eliminate these console warnings.

@Fuzzyma
Copy link
Member

Fuzzyma commented Aug 10, 2018

Jeah - with that change Chrome broke the web (again) because it wasnt compatible with anything else.
When you pass the options in, other browsers take it as a boolean true and all of a sudden you have bound to the capture phase instead of the bubble phase. If you know a check to circumvent these, feel free to create PR :)

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

2 participants