-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. #4221
Comments
Looks like it's related to the new event listener options. More on it here and here There is no a new options object that can be passed to the addEventListener. The warning is saying the passive event listeners on the page should be passed the {passive: true} option to improve scroll performance. These warnings are only performance recommendation so it's not really something to get too worried about, although performances improvements are always good. |
Using https://github.com/zzarcon/default-passive-events will remove some of those violation warnings, but there is still some left. |
Removes an unnecessary `touchstart` listener on the button toggle. It was initially added to prevent it from capturing user events, however it's no longer necessary, because we have `pointer-events: none` on the element. This also fixes a warning that is being logged by Chrome. Fixes angular#4221.
) Removes an unnecessary `touchstart` listener on the button toggle. It was initially added to prevent it from capturing user events, however it's no longer necessary, because we have `pointer-events: none` on the element. This also fixes a warning that is being logged by Chrome. Fixes #4221.
what about "bind"? |
I can not understand why this is closed, the problem always exist and only this: |
Yup, can confirm that this is still happening |
Yes still getting this warning: zone.js:1666 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. |
@andrewseguin are there any recommended solutions for this issue? |
This seems to have gotten worse with beta 12. Displaying a dialog used to appear instantly, now it takes close to 2 seconds for the dialog to appear. The following message is logged about 1200 times from the time I click the button to display a dialog and it appearing. On Material beta 11 it was not logged at all while displaying the dialog. It looks my specific issue is being caused by a mat-autocomplete with a large data set. I'll create a plunker to demonstrate it. |
Here is a plunker showing the issue with slowing down substantially with large data sets. I added a button to display the autocomplete to make it easier to see the slow down. Also if you open the dev tools and set logging to verbose you can see how many event listeners are being created. It looks like it creates two listeners for each item that is added. I will create a new issue for this. |
FWIW, those |
this is still happening, should we create a new issue about this, because this one is "closed" when it really isn't resolved at anyway ? Or @casesandberg did you close this issue by mistake ? |
Thanks @d3viant0ne do you know when this is likely to be released? I'm getting a lot of [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' events appearing in the console and my forms are really slow to load.... It reports back that Keeping my fingers crossed that #7557 resolves these issues! |
I'm running on That build is stable & works with Angular 5.x, at least within the scope of what I am doing. material2-builds are static if you target the hash, really no different than a published build in the strictest sense. |
Thanks again @d3viant0ne Upgraded my project to Angular 5 and the build you're on - weirdly still an issue for me. This occurs 8000+ times - [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. As a result the form takes around 20 seconds to load - same as @micahwood plunker as he said the larger the dataset the more event listeners |
@debslord - I'll take another look with the filters off. 90% sure the |
Thank you! I will see about implementing default-passive-events I might have to result to that fix instead |
I think my issues are probably more around the autocomplete issues mentioned in #5113 and #7749 Implementing default-passive-events doesn't work either as there seems to be an issue around click events already having this set by default and so it throws an error instead and although the toughstart issues aren't displayed in the console the click still takes much too long. I'm hoping the other two issues will resolve this. Thanks for you help. |
Please when is this going to be fixed, this is slowing down my app's performance like crazy. Thank you |
This is back in 5.0.0-rc.3(?) |
I have same issues with 5.0.0-rc.3 |
It should be fixed by #8719. |
@crisbeto which release will this be in? |
I find one solution to solve this warning. (It works fine for me)
|
it's fixed in 5.0.0-rc.2, and appear again in ">= 5.0.0-rc.3" |
i am facing this same issue in recaptcha_en.js s can anyone tell me ow can i enable passive=true for recaptcha |
console warnings from angular-material. Described here: angular/components#4221 We are using https://github.com/angular/material/ (the AngularJS 1.x version) for My Publications. Updating AngularJS dependency versions slightly.
console warnings from angular-material. Described here: angular/components#4221 We are using https://github.com/angular/material/ (the AngularJS 1.x version) for My Publications. Updating AngularJS dependency versions slightly.
sept 2018 and still hapenning |
@phil123456 which Material components are you using on the page that is logging out the warning? |
sorry I did not realize it was "material" project |
I was having the same issue. It turned out to be the Chrome Extension 'Logitech Smooth Scrolling'. When I turned it off, I no longer saw the violations in my Angular 6 Material app. |
The default-passive-events workaround is horrible, it messes up the available functionality of existing or future eventhandlers that want to |
Any updates on this issue? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
In chrome 58, warnings started appearing on console:
What is the expected behavior?
Don't get this warning on console:
What are the steps to reproduce?
Just running the template plunker you get this console warning.
Console must be in the verbose level
Plunker: https://goo.gl/DlHd6U
Which versions of Angular, Material, OS, browsers are affected?
Chrome 58.0.3029.81
Mac OSX 10.12.4 (Sierra)
The text was updated successfully, but these errors were encountered: