1

I'm monitoring the size of an element in angular using ResizeObserver

 observer = new window.ResizeObserver(entries => {
     ...
     someComponent.width = width;
 });
 observer.observe(target);

stackblitz

When you run the code in safary, firefox or chrome 63 it works just fine

enter image description here

So, in chrome 64 (can-i-use -> native support) it doesn't work any more and it looks like this:

enter image description here

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

Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333

1 Answers1

1

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

jiali passion
  • 1,691
  • 1
  • 14
  • 19