Skip to content

MudDialog: Wire title into accessible name via aria-labelledby#12948

Merged
danielchalmers merged 2 commits intodevfrom
copilot/fix-muddialog-title-announcement
Apr 7, 2026
Merged

MudDialog: Wire title into accessible name via aria-labelledby#12948
danielchalmers merged 2 commits intodevfrom
copilot/fix-muddialog-title-announcement

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Screen readers were announcing opened dialogs as generic “dialog” without the dialog title, making context unclear on open. This change gives MudDialog an explicit accessible name by linking the dialog container to its rendered title element.

  • Accessibility wiring in dialog container

    • Added aria-labelledby to the role="dialog" element in MudDialogContainer.
    • Added a stable, per-dialog title id and linked it from aria-labelledby.
    • Kept behavior conditional: when header is hidden (NoHeader), aria-labelledby is omitted.
  • Targeted dialog coverage

    • Added unit coverage to assert:
      • titled dialogs render aria-labelledby and that it resolves to .mud-dialog-title
      • headerless dialogs do not render aria-labelledby
<div role="dialog"
     aria-labelledby="@(GetHideHeader() ? null : $"_{Id:N}_title")">
    @if (!GetHideHeader())
    {
        <div id="@($"_{Id:N}_title")" class="@TitleClassname">
            ...
        </div>
    }
</div>

Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor/sessions/208dcd9e-0584-4d8e-b309-d30e76629f32

Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix screen reader announcement for MudDialog title Wire MudDialog title into accessible name via aria-labelledby Apr 1, 2026
Copilot AI requested a review from danielchalmers April 1, 2026 21:33
@danielchalmers danielchalmers marked this pull request as ready for review April 1, 2026 21:55
@mudbot mudbot bot changed the title Wire MudDialog title into accessible name via aria-labelledby MudDialog: Wire title into accessible name via aria-labelledby Apr 1, 2026
@mudbot mudbot bot added accessibility Accessibility concerns (ARIA, keyboard, focus, screen readers, contrast) enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library labels Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility Accessibility concerns (ARIA, keyboard, focus, screen readers, contrast) enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Screen reader does not announce MudDialog title on open

2 participants