mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-05-01 23:56:41 +07:00
#58 fixed dialog routers
This commit is contained in:
parent
3e8c2d4b6e
commit
124719c243
15 changed files with 93 additions and 39 deletions
|
@ -16,10 +16,10 @@ export const useCloseOnEscape = (onRequestClose?: () => void, ignore_inputs = fa
|
|||
);
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener('keyup', onEscape);
|
||||
document.addEventListener('keyup', onEscape);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('keyup', onEscape);
|
||||
document.removeEventListener('keyup', onEscape);
|
||||
};
|
||||
}, [onEscape]);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue