B: Prevent default behavior when ESC is intercepted

This commit is contained in:
Ivan 2025-04-02 17:43:15 +03:00
parent b29a9d603f
commit 20b56f59b4

View File

@ -6,6 +6,8 @@ export function useEscapeKey(handleClose: () => void, isEnabled: boolean = true)
const handleEscKey = useCallback(
(event: KeyboardEvent) => {
if (event.key === 'Escape') {
event.preventDefault();
event.stopPropagation();
handleClose();
}
},