jargon

Frontend & browser·Storage and platform APIs

you reacted to the element changing size instead of listening for the window resizing.

ResizeObserver

Also calledresize observer

An API reporting size changes of specific elements, whatever caused them — window resize, content change, a sibling growing. It gives the measurement without a forced layout, which is what makes it the correct replacement for measuring in a resize handler. Writing a style in its callback that changes the observed size produces a loop the browser detects and reports as an error.

Commonly confused with