Dialog hotkeys
#3785
Replies: 1 comment
-
The escape key is handled by the underlying dialog web component. Sorry, but it is not feasible for us at the moment to add any further hotkey support. |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
In our internal Blazor application, we're heavily optimizing for keyboard navigation — our users strongly prefer hotkeys over mouse interactions.
We noticed that while it's possible to implement hotkey support in custom dialogs by wrapping the dialog in a <div @onkeydown=HandleKeyDown> block (like below):
...this approach isn't currently possible with built-in dialogs created using:
DialogService.ShowConfirmationAsync
DialogService.ShowErrorAsync
DialogService.ShowInfoAsync... etc.
These default dialogs don’t expose a way to hook into keyboard events or inject key listeners.
💡 Proposal
It would be awesome if hotkey support could be added similarly to how Escape cancels the dialog — for example:
Ctrl + Enter could confirm/submit the dialog
Allow OnKeyDown or KeyHandlers as parameters in both:
ShowDialogAsync() custom dialogs and built-in:
DialogService.ShowConfirmationAsync
DialogService.ShowErrorAsync
DialogService.ShowInfoAsync... etc.
This would make dialogs more keyboard-accessible, and reduce the need to re-implement standard components just for keyboard support.
Thanks in advance for considering this!
Beta Was this translation helpful? Give feedback.
All reactions