Skip to content

fix(ComposedModal): add alert prop to support alertdialog role#21985

Open
nami8824 wants to merge 1 commit intocarbon-design-system:mainfrom
nami8824:fix/composedmodal-alert-prop
Open

fix(ComposedModal): add alert prop to support alertdialog role#21985
nami8824 wants to merge 1 commit intocarbon-design-system:mainfrom
nami8824:fix/composedmodal-alert-prop

Conversation

@nami8824
Copy link
Copy Markdown

@nami8824 nami8824 commented Apr 8, 2026

Add alert prop to ComposedModal that sets role="alertdialog" and aria-describedby pointing to the ModalBody. This allows screen readers to announce alert/error/warning modals appropriately.

Closes #21342

Changelog

New

  • Added alert prop to ComposedModal that enables role="alertdialog" and wires aria-describedby to ModalBody, matching the behavior of `Modal

Testing / Reviewing

  1. Render ComposedModal with alert prop and open prop
  2. Confirm the dialog element has role="alertdialog"
  3. Confirm aria-describedby points to the ModalBody element's id
  4. If ModalBody has a custom id, confirm that id is used

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

Add `alert` prop to ComposedModal that sets role="alertdialog" and
aria-describedby pointing to the ModalBody. This allows screen readers
to announce alert/error/warning modals appropriately.

Closes carbon-design-system#21342
@nami8824 nami8824 requested review from a team as code owners April 8, 2026 23:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

All contributors have signed the DCO.
Posted by the DCO Assistant Lite bot.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 8, 2026

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8aa1207
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69d6e3bede30850008010a35
😎 Deploy Preview https://deploy-preview-21985--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 8, 2026

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 8aa1207
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69d6e3bef6d9ed0008b14f97
😎 Deploy Preview https://deploy-preview-21985--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nami8824
Copy link
Copy Markdown
Author

nami8824 commented Apr 8, 2026

I have read the DCO document and I hereby sign the DCO.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[a11y]: ComposedModal lacks support for aria-describedby

1 participant