Skip to content

Commit

Permalink
fix(defineShortcuts): err with input autocomplete that triggers `keyd…
Browse files Browse the repository at this point in the history
…own`
  • Loading branch information
benjamincanac committed Jun 1, 2023
1 parent 3434bc7 commit 01fa85c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/runtime/composables/defineShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 01fa85c

Please sign in to comment.