-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Bug: Keybindings match too broadly #7434
Copy link
Copy link
Closed
Labels
coreReconciler, DOM, Selection, Node, Events, CompositionReconciler, DOM, Selection, Node, Events, Compositiongood first issueGood for newcomersGood for newcomers
Description
Lexical version: all
Steps to reproduce:
- Focus the playground
- Issue a keyboard shortcut with modifiers that overlap with but do not match exactly the intended shortcut for an existing listener (e.g. Shift+Cmd+K when the existing listener is intended for Cmd+K).
The current behavior
Lexical matches Shift+Cmd+K as Cmd+K because it does not check all modifiers when doing keyboard shortcut matching
The expected behavior
Built-in keyboard shortcuts should exactly match the intended keyboard shortcut, and not handle it if other modifiers are also pressed
Impact of fix
The built-in command listeners for keyboard presses can unintentionally preventDefault and do something else when native behavior is intended
Originally posted by @etrepum in #7412 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreReconciler, DOM, Selection, Node, Events, CompositionReconciler, DOM, Selection, Node, Events, Compositiongood first issueGood for newcomersGood for newcomers