[NgZone] shouldCoalesceChangeDetection option results in infinite change detections
See original GitHub issueThe shouldCoalesceChangeDetection
option added in https://github.com/angular/angular/pull/39422 results in infinite change detections done as a requestAnimationFrame
.
Repro
Repro: https://stackblitz.com/edit/angular-1ucpvz
This happens in an empty Angular app just by turning on the option:
platformBrowserDynamic()
.bootstrapModule(AppModule, {
ngZoneRunCoalescing: true
})
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Boosting performance of Angular applications with manual ...
Angular uses NgZone/Zone.js to know when to trigger UI update (change detection) when our app data state changes. It brilliantly utilized the events...
Read more >The Curious Case of Angular and the Infinite Change Event ...
We set the Angular change detection strategy from ChangeDetectionStrategy.Default (look for changes everywhere) to ChangeDetectionStrategy.
Read more >NgZone - Angular
This guide describes how to use Angular's NgZone to automatically detect ... The result of change detection is that the DOM is updated...
Read more >Optimizing Angular Change Detection Triggered by DOM Events
The second option is to run the event outside of the Angular zone. We can do so by obtaining a reference to NgZone...
Read more >Change detection: Getting in the (Angular) zone! - Educative.io
Who knew that an event binding in one component could cause a display bug in another? We will explain the issue before showing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That said, given that the option exists but doesn’t work correctly in Angular 11, shouldn’t it be merged there?
@JiaLiPassion yes, the mentioned changes was merged Feb 22 after v11.2.0 was released (Feb 11), so the change would be released in v12.0.0.
@mleibman the change that @JiaLiPassion refers to was already merged into Google’s codebase. Do you experience this issue in an internal project or external?