mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 18:30:35 +01:00
fix(defineShortcuts): allow meta_- shortcut (#4321)
This commit is contained in:
@@ -151,7 +151,7 @@ export function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: Shor
|
|||||||
// Parse key and modifiers
|
// Parse key and modifiers
|
||||||
let shortcut: Partial<Shortcut>
|
let shortcut: Partial<Shortcut>
|
||||||
|
|
||||||
if (key.includes('-') && key !== '-' && !key.match(chainedShortcutRegex)?.length) {
|
if (key.includes('-') && key !== '-' && !key.includes('_') && !key.match(chainedShortcutRegex)?.length) {
|
||||||
console.trace(`[Shortcut] Invalid key: "${key}"`)
|
console.trace(`[Shortcut] Invalid key: "${key}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ export function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options: Shor
|
|||||||
console.trace(`[Shortcut] Invalid key: "${key}"`)
|
console.trace(`[Shortcut] Invalid key: "${key}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const chained = key.includes('-') && key !== '-'
|
const chained = key.includes('-') && key !== '-' && !key.includes('_')
|
||||||
if (chained) {
|
if (chained) {
|
||||||
shortcut = {
|
shortcut = {
|
||||||
key: key.toLowerCase(),
|
key: key.toLowerCase(),
|
||||||
|
|||||||
Reference in New Issue
Block a user