useFocusReturn

Return the focus to the element that had it before something opened, such as a modal.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

Close the box and the focus goes back to the button that opened it.

APIs

useFocusReturn

const useFocusReturn = (options: {
  opened: boolean
  shouldReturnFocus?: boolean
}) => () => void
Edit this page on GitHub