Reputation: 29149
I'm monitoring the size of an element in angular using ResizeObserver
observer = new window.ResizeObserver(entries => {
...
someComponent.width = width;
});
observer.observe(target);
When you run the code in safary, firefox or chrome 63 it works just fine
So, in chrome 64 (can-i-use -> native support) it doesn't work any more and it looks like this:
Somehow chrome doesn't do changeDetection for triggers from ResizeObserver
Any suggestion what might be the reason for this strange behaviour?
UPDATE: I'v updated my post based on the discussion below
Upvotes: 1
Views: 513
Reputation: 1711
zone.js provide a patch for ResizeObserver >= chrome 64, it is not released, please wait for next version of zone.js (0.8.21) https://github.com/angular/zone.js/pull/1012 here is a working sample.
https://github.com/JiaLiPassion/zone-resize-observer
Upvotes: 1