WICG / resize-observer

This repository is no longer active. ResizeObserver has moved out of WICG into
https://github.com/w3c/csswg-drafts/tree/master/resize-observer-1
Other
255 stars 18 forks source link

Resize events on inline elements #65

Closed bobOnGitHub closed 4 years ago

bobOnGitHub commented 4 years ago

I see there was a discussion on resize events for inline elements in issue #19

The current state of affairs appears to be that events do not fire as a result of size changes to existing inline elements and this appears to be the agreed behaviour for ResizeObserver (Observations do not fire for non-replaced inline Elements).

Consequently, ResizeObserver is of no use with regard to inline elements.

Reading here the case for ResizeObserver is the need to be able to react to a component size change.

However, a component can be styled as inline by the consumer at which point you are back to square 1.

Example : Your component renders an image with height to match the host height. The host has been styled inline with font size 24pt. The user increases the fontsize to 48pt and you have no event to react to and re-render the image.

I can't see why it should matter whether the element is inline/block/inline-block etc. All that matters if you are monitoring size changes is size.

I'd suggest that ResizeObserver should fire an event for a size change on an observed element regardless of anything else.

bobOnGitHub commented 4 years ago

moved to CSSWG