fix(defineShortcuts): err with input autocomplete that triggers keydown

This commit is contained in:
Benjamin Canac
2023-06-01 15:26:46 +02:00
parent 3434bc7f2b
commit 01fa85c7a3

View File

@@ -33,6 +33,9 @@ export const defineShortcuts = (config: ShortcutsConfig) => {
let shortcuts: Shortcut[] = []
const onKeyDown = (e: KeyboardEvent) => {
// Input autocomplete triggers a keydown event
if (!e.key) { return }
const alphabeticalKey = /^[a-z]{1}$/i.test(e.key)
for (const shortcut of shortcuts) {