Skip to content

[alert][dialog] Accessibility improvements#48113

Merged
silviuaavram merged 10 commits intomui:masterfrom
silviuaavram:docs/alert-improvements
Mar 31, 2026
Merged

[alert][dialog] Accessibility improvements#48113
silviuaavram merged 10 commits intomui:masterfrom
silviuaavram:docs/alert-improvements

Conversation

@silviuaavram
Copy link
Copy Markdown
Member

@silviuaavram silviuaavram commented Mar 27, 2026

  • I have followed (at least) the PR section of the contributing guide.

  • Make Dialog accept a role prop so we could pass "alertdialog" to it.

  • Use "alertdialog" in the Dialog docs, for the Alert Dialog examples.

  • Change the Alert Dialog link in the Alert docs to navigate directly to the relevant example.

  • Provide information about the role="status" in the Accessibility section of the Alert docs.

Fixes #40198

Copilot AI review requested due to automatic review settings March 27, 2026 08:55
@silviuaavram silviuaavram added docs Improvements or additions to the documentation. scope: dialog Changes related to the dialog. scope: alert Changes related to the alert. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. v7.x needs cherry-pick The PR should be cherry-picked to master after merge. labels Mar 27, 2026
@mui-bot
Copy link
Copy Markdown

mui-bot commented Mar 27, 2026

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+11B(0.00%) 🔺+16B(+0.01%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 7b537d4

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds accessibility-focused enhancements around alert dialogs by letting Dialog set an explicit ARIA role, updating demos/docs to use role="alertdialog" where appropriate, and expanding a11y guidance/testing.

Changes:

  • Add a role prop to Dialog (defaulting to "dialog") and allow overriding to "alertdialog".
  • Update Dialog alert dialog demos/docs to pass role="alertdialog".
  • Improve/extend accessibility documentation and tests (Dialog a11y tests, Alert a11y guidance, DialogTitle heading default test).

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/mui-material/src/DialogTitle/DialogTitle.test.js Adds a regression test asserting the default heading level/tag for DialogTitle.
packages/mui-material/src/Dialog/Dialog.test.js Adds a11y tests for aria-describedby and role override behavior.
packages/mui-material/src/Dialog/Dialog.spec.tsx Adds a TS usage check for role="alertdialog".
packages/mui-material/src/Dialog/Dialog.js Implements role prop wiring to the dialog element and adds generated PropTypes entry/docs.
packages/mui-material/src/Dialog/Dialog.d.ts Adds the role prop to the public TS API/docs.
docs/data/material/components/dialogs/dialogs.md Documents using role="alertdialog" for alert dialog usage.
docs/data/material/components/dialogs/AlertDialogSlide.tsx Updates demo to set role="alertdialog".
docs/data/material/components/dialogs/AlertDialogSlide.js Updates demo to set role="alertdialog".
docs/data/material/components/dialogs/AlertDialog.tsx Updates demo to set role="alertdialog".
docs/data/material/components/dialogs/AlertDialog.js Updates demo to set role="alertdialog".
docs/data/material/components/alert/alert.md Updates the dialog link target and adds guidance about role="status"/live regions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/mui-material/src/Dialog/Dialog.test.js
Comment thread docs/data/material/components/alert/alert.md Outdated
Comment thread docs/data/material/components/alert/alert.md Outdated
Comment thread packages/mui-material/src/Dialog/Dialog.js Outdated
Comment thread docs/data/material/components/dialogs/dialogs.md Outdated
@mj12albert
Copy link
Copy Markdown
Member

Any relation to this issue? #47892

@silviuaavram silviuaavram force-pushed the docs/alert-improvements branch from 5037a8f to 8d9c3d0 Compare March 30, 2026 12:23
@silviuaavram
Copy link
Copy Markdown
Member Author

No, @mj12albert , I was not looking at the Narrator issue.

Comment thread packages/mui-material/src/Dialog/Dialog.test.js Outdated
Copy link
Copy Markdown
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

Please check @ZeeshanTamboli comment. The rest looks good to me.

@silviuaavram silviuaavram force-pushed the docs/alert-improvements branch from 8d9c3d0 to 9032555 Compare March 31, 2026 08:15
Comment thread packages/mui-material/src/DialogTitle/DialogTitle.test.js
Comment thread docs/data/material/components/alert/alert.md Outdated
@silviuaavram silviuaavram merged commit e65f91f into mui:master Mar 31, 2026
23 checks passed
@silviuaavram silviuaavram deleted the docs/alert-improvements branch March 31, 2026 10:22
@github-actions
Copy link
Copy Markdown

Cherry-pick PRs will be created targeting branches: v7.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y docs Improvements or additions to the documentation. needs cherry-pick The PR should be cherry-picked to master after merge. scope: alert Changes related to the alert. scope: dialog Changes related to the dialog. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. v7.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[material-ui][Alert] Potential accessibility issues

7 participants