Skip to content

Add ariaLabelledBy prop to Dialog - #2577

Closed
anuj-pal27 wants to merge 1 commit into
dxc-technology:masterfrom
anuj-pal27:fix/dialog-aria-labelledby
Closed

anuj-pal27 wants to merge 1 commit into
dxc-technology:masterfrom
anuj-pal27:fix/dialog-aria-labelledby

Conversation

@anuj-pal27

Copy link
Copy Markdown

Checklist
(Check off all the items before submitting)

  • Build process is done without errors. All tests pass in the /lib directory.
  • Self-reviewed the code before submitting.
  • Meets accessibility standards.
  • Added/updated documentation to /website as needed.
  • Added/updated tests as needed.

Description
DxcDialog always had a hardcoded aria-label="Dialog", so every dialog was announced the same way regardless of its content. Following the W3C dialog pattern, this adds an optional ariaLabelledBy prop that sets aria-labelledby to reference the dialog's title. If it isn't provided, the dialog keeps aria-label="Dialog", so the change is non-breaking.

Additional context
DxcHeading doesn't accept an id, so to use it as the title it has to be wrapped in an element with an id. Adding an id prop to DxcHeading could be a follow-up if wanted.

Closes #2139

@Jialecl

Jialecl commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Thanks again for your time and aportation, but exposing the ariaLabelledBy is not the correct solution in our opinion. We are not forcing any type of Heading or Title in the dialog. Additionally the contents of any Heading might not match as label of the Dialog and as you correctly mentioned we are not exposing any kind of id prop in our components so it does not make sense to expose the ariaLabelledBy.

We are still grateful for your interest in improving our design system.

@Jialecl Jialecl closed this Oct 21, 2026
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.

aria-label="Dialog" inside the Dialog is not accessible enough

2 participants