Skip to content

Commit

Permalink
Fix focus return when dismissed
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Aug 20, 2023
1 parent 74851c8 commit 6b08003
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/components/src/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type { ForwardedRef, KeyboardEvent, UIEvent } from 'react';
import {
createPortal,
useCallback,
useEffect,
useRef,
useState,
forwardRef,
Expand Down Expand Up @@ -100,7 +99,7 @@ function UnforwardedModal(
}
}, [ contentRef ] );

useEffect( () => {
useLayoutEffect( () => {
openModalCount++;

if ( openModalCount === 1 ) {
Expand Down

0 comments on commit 6b08003

Please sign in to comment.