Skip to content

HeldControl

Defined in: react/src/heldControl.ts:13

guard: <E>(handler?) => (event) => void

Defined in: react/src/heldControl.ts:25

Wrap your click handler: a click on a held control does nothing.

E extends MouseEvent<Element, MouseEvent>

(event) => void

(event) => void


held: boolean

Defined in: react/src/heldControl.ts:15

The control’s label is still held: it must not be seen or used yet.


props: object & Record<string, unknown>

Defined in: react/src/heldControl.ts:23

Spread on the control’s element (merge style with your own, after it). While held: invisible, keeping its space, and inert — not focusable, not clickable. On the first paint it carries the reservation’s failsafe instead of inert, so without JavaScript the control reveals itself, label and all, and works.

optional style?: CSSProperties