B: Prevent default behavior when ESC is intercepted
This commit is contained in:
parent
b29a9d603f
commit
20b56f59b4
|
@ -6,6 +6,8 @@ export function useEscapeKey(handleClose: () => void, isEnabled: boolean = true)
|
||||||
const handleEscKey = useCallback(
|
const handleEscKey = useCallback(
|
||||||
(event: KeyboardEvent) => {
|
(event: KeyboardEvent) => {
|
||||||
if (event.key === 'Escape') {
|
if (event.key === 'Escape') {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
handleClose();
|
handleClose();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user