Skip to main content

Module drag

Module drag 

Source
Expand description

Pointer drags that follow the pointer at frame rate without re-rendering the page.

A drag captures the pointer on its handle, so it keeps tracking over iframes and outside the window, and reports movement at most once per animation frame. The caller paints each frame straight onto the DOM (a CSS custom property or an inline size) and commits the final value to its signal once, when the pointer is released. Re-rendering a component as large as the Studio on every pointer event is what made its resizers lag.

Enums§

Axis
The direction a drag resizes, which sets the cursor shown everywhere while it lasts.

Constants§

DRAG_STYLE
While a drag is live: no text selection anywhere, the resize cursor everywhere, and no iframe (the Web preview) swallowing pointer events.