diff --git a/src/Dialog/index.tsx b/src/Dialog/index.tsx index 25bb5c3b..0603582a 100644 --- a/src/Dialog/index.tsx +++ b/src/Dialog/index.tsx @@ -141,6 +141,9 @@ export default function Dialog(props: IDialogChildProps) { useEffect(() => { if (visible) { setAnimatedVisible(true); + if (!contains(wrapperRef.current, document.activeElement)) { + lastOutSideActiveElementRef.current = document.activeElement as HTMLElement; + } } return () => {}; }, [visible]);