Overview
The KFocusTrap
component ensures that keyboard focus is trapped within a
specific region of the page.
When the disabled
prop is set to true
, focus trapping is disabled,
allowing normal tab behavior. The focus trap moves the focus between the first and last
elements in the slot content.
Props
Name | Description | Type | Default | Required |
---|---|---|---|---|
disabled | Disables the focus trap when set to true . Focus will behave normally. | Boolean |
false
| — |
Events
Name | Description |
---|---|
shouldFocusFirstEl | Emits an event to notify the parent component to focus the first element. |
shouldFocusLastEl | Emits an event to notify the parent component to focus the last element. |
Slots
Name | Description |
---|---|
default | Default slot where the focusable content will be rendered |
Methods
Name | Description |
---|---|
reset | Reset the next focus to the first focus element |