Repository navigation
MudDialog: Fix inline dialog ignoring OnKeyDown and OnKeyUp - #14211
Merged
Merged
Conversation
There was a problem hiding this comment.
ShowAsync now passes the inline dialog's OnKeyDown and OnKeyUp through to the dialog the service shows. That's where MudDialogContainer reads them, so the handlers now fire for inline dialogs. The new test covers both callbacks, and I found nothing that needs fixing.
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An inline MudDialog, declared in markup and shown through
VisibleorShowAsync, never invoked itsOnKeyDownorOnKeyUp.ShowAsynccopies the inline dialog's parameters onto the dialog it shows through the dialog service, and those two were missing from the copy, so the dialog container only saw empty callbacks.A dialog shown by the service wasn't affected.
ShowAsyncnow passes both.Tests:
InlineDialog_KeyEvents_ShouldReachOnKeyDownAndOnKeyUpfails on dev. The full MudBlazor.UnitTests suite passes (6,569 passed, 0 failed), with no build warnings on net8.0, net9.0 and net10.0.In the Test Viewer, headless Chrome sent real key events to three dialogs: one shown through
@bind-Visible, one throughShowAsync(), and one shown by the service as the control. On dev only the service dialog logged Enter, a letter, ArrowDown and Tab; with this change all three log the same keys in the same order. Escape still closes each dialog, and typing into a field inside works as before.Found while testing #14208.