Function resizeObserver
- resize
Observer (node, target): ActionReturn<ResizeTarget> Parameters
- node: HTMLElement
The node associated with the action.
- target: ResizeTarget
A ResizeObserverManager target to update with observed width & height changes.
Returns ActionReturn<ResizeTarget>
The action lifecycle methods.
- node: HTMLElement
Provides an action to monitor the given HTMLElement node with ResizeObserver via ResizeObserverManager posting width / height changes to the ResizeObserverData.ResizeTarget in various ways depending on the shape of the target. The target can be one of the following and the precedence order is listed from top to bottom:
resizeObserved
function as attribute; offset then content width / height are passed as parameters.setContentBounds
function as attribute; content width / height are passed as parameters.setDimension
function as attribute; offset width / height are passed as parameters.resizeObserved
as an attribute; updated with offset & content width / height.resizeObserved
as an attribute; updated with offset & content width / height.Note: Svelte currently uses an archaic IFrame based workaround to monitor offset / client width & height changes. A more up to date way to do this is with ResizeObserver. To track when Svelte receives ResizeObserver support monitor this issue: https://github.com/sveltejs/svelte/issues/4233
Can-I-Use: https://caniuse.com/resizeobserver