mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 19:57:55 +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[] = []
|
let shortcuts: Shortcut[] = []
|
||||||
|
|
||||||
const onKeyDown = (e: KeyboardEvent) => {
|
const onKeyDown = (e: KeyboardEvent) => {
|
||||||
|
// Input autocomplete triggers a keydown event
|
||||||
|
if (!e.key) { return }
|
||||||
|
|
||||||
const alphabeticalKey = /^[a-z]{1}$/i.test(e.key)
|
const alphabeticalKey = /^[a-z]{1}$/i.test(e.key)
|
||||||
|
|
||||||
for (const shortcut of shortcuts) {
|
for (const shortcut of shortcuts) {
|
||||||
|
|||||||
Reference in New Issue
Block a user