Skip to content

Commit

Permalink
Merge pull request #815 from sebgroup/develop
Browse files Browse the repository at this point in the history
next release
  • Loading branch information
eweseong authored Mar 31, 2023
2 parents ba0dc6a + d454cd7 commit 057efb3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/src/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const Modal: React.FC<ModalProps> = React.memo(
switch (e.key) {
case Key.Escape: {
onEscape && onEscape(e as unknown as KeyboardEvent);
triggerRef.current?.focus();
break;
}
case Key.Tab: {
Expand Down Expand Up @@ -79,8 +78,9 @@ export const Modal: React.FC<ModalProps> = React.memo(
return () => {
document.body.classList.remove("modal-open");
triggerRef.current?.focus();
triggerRef.current = undefined;
};
}, [toggle]);
}, [isPristine, toggle]);

return !safeDocument
? null
Expand Down Expand Up @@ -109,7 +109,6 @@ export const Modal: React.FC<ModalProps> = React.memo(

if (onBackdropDismiss && target.classList.contains("rc") && target.classList.contains("modal")) {
onBackdropDismiss(e);
triggerRef.current?.focus();
}
}}
onAnimationEnd={(e) => {
Expand Down

0 comments on commit 057efb3

Please sign in to comment.