mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-18 05:58:07 +01:00
fix(defineShortcuts): err with input autocomplete that triggers keydown
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user