Used to track a DOM Element size and position by using a resize observer provided by ResizeManager.
Execute callbacks when the bounding rectangle of the DOM Element changes, which means when its size and/or position change.

Constructors

Properties

element: HTMLElement

The HTML element to track

priority: number

Priority at which this element onSizeChanged function must be called

isResizing: boolean

Flag indicating whether the timeout is still running and we should avoid a new computation

onSizeChanged: ((boundingRect) => void)

Callback to run whenever the element size changed

Type declaration

onPositionChanged: ((boundingRect) => void)

Callback to run whenever the element position changed

Type declaration

resizeManager: ResizeManager

The ResizeManager used, basically a wrapper around a ResizeObserver

_boundingRect: DOMElementBoundingRect

Current element bounding rectangle

Accessors

Methods

  • Update our element bounding rectangle because the scroll position has changed

    Parameters

    • delta: DOMPosition = ...

      scroll delta values along X and Y axis

    Returns void