Focus Trap
Trap focus within a DOM node.
# Dependencies
This module depends on focus-trap.
# API
# FocusTrapConfig
Property | Description | Default |
---|---|---|
immediate? |
boolean Immediately activate the trap |
— |
# FocusTrapReturn
Property | Description |
---|---|
hasFocus |
Readable<boolean> Indicates if the focus trap is currently active. |
isPaused |
Readable<boolean> Indicates if the focus trap is currently paused. |
activate |
(opts?: ActivateOptions) => void Activate the focus trap. |
deactivate |
(opts?: DeactivateOptions) => void Deactivate the focus trap. |
pause |
() => void Pause the focus trap. |
unpause |
() => void Unpauses the focus trap. |
useFocusTrap |
Action<HTMLElement, void> Action to attach to the element that you want to act as a focus trap. |