Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular 2 and passive listeners

I came across this git https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md with shows how developer can improve scroll performance by adding 'passive listeners'. I first saw it when my chrome showed me warnings ( The exact warning is "Handling of 'touchstart' input event was delayed for 126 ms due to main thread being busy. Consider marking event handler as 'passive' to make the page more responsive.").

It seems like pretty easy implementation, The problem is that most of the time I'm not the one who attach listeners, The angular 2 platform does. I'm getting those warnings when I click on buttons with (click) and animations stats playing.

Is there a way to combine angular 2 listeners and passive listeners?

like image 262
Gili Yaniv Avatar asked Dec 19 '16 08:12

Gili Yaniv


2 Answers

As of March 2018, this is still "in consideration" and has not been implemented. However, there's a small utility you can use to add them as a directive; the best way unfortunately requires compiler support.

like image 147
RmxPatrick Avatar answered Sep 27 '22 20:09

RmxPatrick


This is being considered but not yet implemented

See also https://github.com/angular/angular/issues/8866 https://github.com/angular/angular/issues/11200 might also be related.

like image 39
Günter Zöchbauer Avatar answered Sep 27 '22 20:09

Günter Zöchbauer