Skip to content

Commit

Permalink
docs(FloatingFocusManager): add restoreFocus prop
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Jun 22, 2024
1 parent 5adb7e1 commit ef8007b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions website/pages/docs/FloatingFocusManager.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ interface FloatingFocusManagerProps {
| number
| React.MutableRefObject<HTMLElement | null>;
returnFocus?: boolean;
restoreFocus?: boolean;
guards?: boolean;
modal?: boolean;
visuallyHiddenDismiss?: boolean | string;
Expand Down Expand Up @@ -146,6 +147,21 @@ This prop is ignored if the floating element lost focus.
</FloatingFocusManager>
```

### `restoreFocus{:.keyword}`

default: `false{:js}`

Determines if focus should be restored to the nearest tabbable
element if the currently focused element inside the floating
element was removed from the DOM (causing focus to be lost
otherwise).

```js
<FloatingFocusManager context={context} restoreFocus={true}>
{/* floating element */}
</FloatingFocusManager>
```

### `guards{:.keyword}`

default: `true{:js}`
Expand Down

0 comments on commit ef8007b

Please sign in to comment.