Focus trap
Use EuiFocusTrap to prevent keyboard-initiated focus from leaving a defined area. Temporary flows and UX escapes that occur in components such as EuiModal and EuiFlyout are prime examples.
For components that project content in a React portal, EuiFocusTrap will maintain the tab order expected by users.
- UseclickOutsideDisablesto disable the focus trap when the user clicks outside the trap.
- UsenoIsolation={false}when pointer events on outside elements should be disallowed.
- UsecrossFrame={true}when focus should not be allowed on other iframes on the page.
Props
EuiFocusTrap
| Prop | Description and type | Default value | 
|---|---|---|
| Prop className# | Description and type Type:  string | Default value | 
| Prop css# | Description and type Type:  Interpolation<Theme> | Default value | 
| Prop style# | Description and type Type:  CSSProperties | Default value | 
| Prop disabled# | Description and type Type:  boolean | Default value false | 
| Prop closeOnMouseup# | Description and type Whether  boolean | Default value | 
| Prop clickOutsideDisables# | Description and type Clicking outside the trap area will disable the trap boolean | Default value false | 
| Prop initialFocus# | Description and type Reference to element that will get focus when the trap is initiated ElementTarget | Default value | 
| Prop gapMode# | Description and type if  "padding" | "margin" | Default value padding | 
| Prop crossFrame# | Description and type Configures focus trapping between iframes. boolean | Default value false | 
| Prop scrollLock# | Description and type Type:  boolean | Default value false | 
| Prop noIsolation# | Description and type Type:  boolean | Default value true | 
| Prop returnFocus# | Description and type Type:  boolean | FocusOptions | ((returnTo: Element) => boolean | FocusOptions) | Default value true |