[alert][dialog] Accessibility improvements#48113
Merged
silviuaavram merged 10 commits intomui:masterfrom Mar 31, 2026
Merged
Conversation
Netlify deploy previewBundle size report
|
Contributor
There was a problem hiding this comment.
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
roleprop toDialog(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.
mj12albert
reviewed
Mar 27, 2026
Member
|
Any relation to this issue? #47892 |
5037a8f to
8d9c3d0
Compare
Member
Author
|
No, @mj12albert , I was not looking at the Narrator issue. |
siriwatknp
approved these changes
Mar 31, 2026
Member
siriwatknp
left a comment
There was a problem hiding this comment.
Please check @ZeeshanTamboli comment. The rest looks good to me.
8d9c3d0 to
9032555
Compare
ZeeshanTamboli
approved these changes
Mar 31, 2026
|
Cherry-pick PRs will be created targeting branches: v7.x |
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.
I have followed (at least) the PR section of the contributing guide.
Make
Dialogaccept aroleprop 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 theAccessibilitysection of the Alert docs.Fixes #40198