Skip to content

MudDialog: Update title, class and style of service-opened dialogs - #14116

Merged
danielchalmers merged 10 commits into
MudBlazor:devfrom
danielchalmers:dialog-update-title-style-class
Nov 2, 2026
Merged

danielchalmers merged 10 commits into
MudBlazor:devfrom
danielchalmers:dialog-update-title-style-class

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

In a dialog opened with IDialogService, MudDialog renders inside your content component, but MudDialogContainer renders the title bar and the outer element that carries Class and Style. When the content component re-rendered, MudDialog re-rendered with it, but the container didn't. So changes to TitleContent, Class or Style made after the dialog opened never showed. Inline dialogs already forward their renders to the container, so they weren't affected.

Changes:

  • After each render, a service-opened MudDialog asks its container to re-render, as inline dialogs already do.
  • The container reads Style and TitleContent from the registered MudDialog when it renders, as it already did for Class. Before, it kept the copies taken when the dialog registered.

The forwarding can't loop. The container renders the dialog content through a wrapper that renders it only once, so a container re-render doesn't re-render the content component. A test pins this with a reference-type dialog parameter.

Before

image

After

image

Related closed reports: #7201, #7039, #4519, #6896.

Replaces #13837 by KiristonK, whose commits this carries. That PR copied the dialog's values onto the container's parameters; this version reads them at render time instead.

Closes #13837

KiristonK and others added 10 commits September 7, 2026 11:01
Extend dialog dynamic update tests to Class and Style values.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…t instead of reassigning parameters

Keeps the fix from overwriting [Parameter] properties (AGENTS.md) and drops the leftover questions in comments. Class already reads _dialog.Class in the class builder.
@danielchalmers danielchalmers added the bug Unexpected behavior or functionality not working as intended label Nov 2, 2026

@mudbot mudbot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found, and there are no earlier findings to carry over. A service-opened MudDialog now asks its container to re-render after each render. This can't loop: DialogHelperComponent only renders the content the first time it gets parameters, and the container's cascading value is fixed. For inline dialogs the only effect is one extra, harmless container render. CurrentStyle and CurrentTitleContent read the registered dialog's values at render time, the same way Classname already reads Class. The new tests exercise both changes, and their names and viewer components follow AGENTS.md.

This was referenced Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants