Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(CDK Dialog): aria-hidden is not removed when a child dialog is opened before but closed after a parent dialog. #30028

Open
1 task
XLeapZan opened this issue Nov 15, 2024 · 0 comments
Labels
needs triage This issue needs to be triaged by the team

Comments

@XLeapZan
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When an application uses routing, the application has its CDK Dialog instance (A), and the route's component has its own CDK Dialog instance (B), which has A as its parent.

When B opens a component in an overlay, it sets the aria-hidden attributes.

When the application provides a set of shared dialog components and a service to open them, they are opened from A, and aria-hidden attributes are not set because they are already present. (see Dialog._hideNonDialogContentFromAssistiveTechnology).

When B removes the last dialog (see Dialog._removeOpenDialog) while its parent (A) has dialogs open, the aria-hidden attributes are not removed.

This means that because the parent CDK dialog (A) doesn't know that the child dialog had any attributes set, the aria-hidden attributes are never removed again, and the application becomes inaccessible to assistive technologies.

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-aa1qpb
Steps to reproduce:

  1. Click on Load Child
  2. Click on Show Dialog
  3. In the dialog click 'save and close'
  4. observe the 'wait dialog' being opened (before the Dialog is closed)
  5. the dialog is closed
  6. after the wait dialog is closed check the

Expected Behavior

All aria-hidden attributes set by dialogs are removed again.

Actual Behavior

The aria-hidden attributes set by CDK Dialog B remain.

Environment

  • Angular: 18.2.8
  • CDK/Material: 18.2.8
  • Browser(s): Any
  • Operating System (e.g. Windows, macOS, Ubuntu): Any
@XLeapZan XLeapZan added the needs triage This issue needs to be triaged by the team label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

1 participant