Home > @findkit/ui > FindkitUI > trapFocus

FindkitUI.trapFocus() method

Add additional elements to focus trap when modal is open

Signature:

trapFocus(selector: ElementSelector<HTMLElement>): () => void;

Parameters

Parameter Type Description
selector ElementSelector<HTMLElement> A CSS selector or an element

Returns:

() => void

cleanup function