Closed yasushi-saito closed 2 years ago
The current SizeHelper reacts only to explicit window size changes and not to layout changes inside the window. This change adds a new function onSizeChangeForElement that uses ResizeObserver to detect when the size of a DOM element a changes.
ResizeObserver is supported by all modern browsers now (https://caniuse.com/#feat=resizeobserver).
An aside: I'm not sure if element size caching in SizeHelper is adding much value. If we remove it, the code will become simpler.
The current SizeHelper reacts only to explicit window size changes and not to layout changes inside the window. This change adds a new function onSizeChangeForElement that uses ResizeObserver to detect when the size of a DOM element a changes.
ResizeObserver is supported by all modern browsers now (https://caniuse.com/#feat=resizeobserver).
An aside: I'm not sure if element size caching in SizeHelper is adding much value. If we remove it, the code will become simpler.