Skip to content

Commit

Permalink
fix(modal onclickoutside): modal onClickOutside=false fails on Esc ke…
Browse files Browse the repository at this point in the history
…y press
  • Loading branch information
betsay27 committed Nov 2, 2023
1 parent 5a2ef99 commit e442c88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const Modal = forwardRef<ModalApi, ModalProps>(

const escFunction = useCallback(
(event: KeyboardEvent) => {
if (event.code === 'Escape') {
if (event.code === 'Escape' && onClickOutside) {
animateClose(handleEsc, event);
}
},
Expand Down

0 comments on commit e442c88

Please sign in to comment.