FocusTrapProps

Properties

Link copied to clipboard
abstract external override var children: ReactNode?

A single child content element.

Link copied to clipboard
abstract external var disableAutoFocus: Boolean?

If true, the focus trap will not automatically shift focus to itself when it opens, and replace it to the last focused element when it closes. This also works correctly with any focus trap children that have the disableAutoFocus prop.

Link copied to clipboard
abstract external var disableEnforceFocus: Boolean?

If true, the focus trap will not prevent focus from leaving the focus trap while open.

Link copied to clipboard
abstract external var disableRestoreFocus: Boolean?

If true, the focus trap will not restore focus to previously focused element once focus trap is hidden or unmounted.

Link copied to clipboard
abstract external var getTabbable: (root: HTMLElement) -> ReadonlyArray<String>?

Returns an array of ordered tabbable nodes (i.e. in tab order) within the root. For instance, you can provide the "tabbable" npm dependency.

Link copied to clipboard
abstract external var isEnabled: () -> Boolean?

This prop extends the open prop. It allows to toggle the open state without having to wait for a rerender when changing the open prop. This prop should be memoized. It can be used to support multiple focus trap mounted at the same time.

Link copied to clipboard
abstract external var key: Key?
Link copied to clipboard
abstract external var open: Boolean

If true, focus is locked.

Functions

Link copied to clipboard
open inline external fun <P : Props> child(type: ElementType<P>, props: P)
Link copied to clipboard
open inline operator external fun <P : Props> ElementType<P>.invoke()
open inline operator external fun <P : Props> ElementType<P>.invoke(noinline block: P.() -> Unit)
open inline operator external fun <T> Provider<T>.invoke(value: T, noinline block: ChildrenBuilder.() -> Unit)
Link copied to clipboard
open inline operator external fun Char.unaryPlus()
open inline operator external fun String?.unaryPlus()
open inline operator external fun ReactNode?.unaryPlus()
open inline operator external fun Props?.unaryPlus()