Replies: 1 comment
-
|
Attach #44 to fix this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, hotkeys supports the ignoreInputs option, which is great for preventing global shortcuts from triggering while typing. However, in many real-world scenarios, we need more granular control.
The Problem:
We are building a rich text editor where shortcuts (like Cmd+Z for undo) are registered globally on the document.
Scenario A: When a user is typing in the main editor body, we want Cmd+Z to trigger our custom undo logic.
Scenario B: If the user moves focus to a comment input or a sidebar text field, we want to ignore the global shortcut and let the browser's default input behavior take over.
Currently, if we set ignoreInputs: true, Scenario A fails. If we set it to false, Scenario B triggers the wrong undo logic.
The Proposal:
Allow ignoreInputs to accept a predicate function, or introduce a filter option. This would allow us to check the event target and decide whether to skip the shortcut based on the UI context.
Beta Was this translation helpful? Give feedback.
All reactions