From e442c881db0a2fcb3bec3a60527eb8e3b8936978 Mon Sep 17 00:00:00 2001 From: Betsy Trammell Date: Thu, 2 Nov 2023 11:20:04 -0500 Subject: [PATCH] fix(modal onclickoutside): modal onClickOutside=false fails on Esc key press --- src/components/Modal/Modal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Modal/Modal.tsx b/src/components/Modal/Modal.tsx index 64c7ea8a2..94648759b 100644 --- a/src/components/Modal/Modal.tsx +++ b/src/components/Modal/Modal.tsx @@ -229,7 +229,7 @@ const Modal = forwardRef( const escFunction = useCallback( (event: KeyboardEvent) => { - if (event.code === 'Escape') { + if (event.code === 'Escape' && onClickOutside) { animateClose(handleEsc, event); } },