Improved key event handling

This commit is contained in:
the-djmaze 2023-02-21 14:26:37 +01:00
parent 81d521c562
commit 1c1b043a50
7 changed files with 35 additions and 43 deletions

View file

@ -33,6 +33,11 @@ export const
new CustomEvent(name, {detail:detail, cancelable: !!cancelable})
),
stopEvent = event => {
event.preventDefault();
event.stopPropagation();
},
formFieldFocused = () => doc.activeElement?.matches('input,textarea'),
addShortcut = (...args) => shortcuts.add(...args),