Skip to content

Commit

Permalink
Update useFocusReturn to fix focus loss in modal
Browse files Browse the repository at this point in the history
when it was opened from another modal or dropdown
  • Loading branch information
brentswisher committed Jan 25, 2021
1 parent 437a546 commit 5c24a7d
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/compose/src/hooks/use-focus-return/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ function useFocusReturn( onFocusReturn ) {

focusedBeforeMount.current = node.ownerDocument.activeElement;
} else if ( focusedBeforeMount.current ) {
const isFocused = ref.current.contains(
ref.current.ownerDocument.activeElement
);

if ( ! isFocused ) {
return;
}

// Defer to the component's own explicit focus return behavior, if
// specified. This allows for support that the `onFocusReturn`
// decides to allow the default behavior to occur under some
Expand Down

0 comments on commit 5c24a7d

Please sign in to comment.