Replies: 1 comment
-
im using this for now, but im not sure if is the best way useEffect(() => {
addEventListener('keydown', handleKey, false);
return () => {
removeEventListener('keydown', handleKey, false);
};
}, [open]);
const handleKey = (event: KeyboardEvent) => {
if (event.key === 'Escape' && open) {
event.preventDefault();
}
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello is there a way to disable the escape key behaviour ?
If i put a stop propagation on the Dialog or the Dialog.Panel it seems to be working but if i focus an element inside the Dialog.panel and then press the escape key it closes the Dialog :V
Beta Was this translation helpful? Give feedback.
All reactions