diff --git a/src/react-pure-modal.tsx b/src/react-pure-modal.tsx index 6172844..23faf58 100644 --- a/src/react-pure-modal.tsx +++ b/src/react-pure-modal.tsx @@ -48,7 +48,7 @@ function PureModal(props: Props) { if (allModals.length && allModals[allModals.length - 1].classList.contains(hash)) return false; - if (event.keyCode === 27 && document.activeElement) { + if (event.key === 'Escape' && document.activeElement) { close(event); } }, []);