Skip to content

fix(cdk/dialog): avoid setting aria-hidden before focus has moved #31030

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented May 5, 2025

The dialog moves focus in an afterRender, because it needs to give the content some time to be rendered. This is problematic with some relatively recent behavior in Chrome where the aria-hidden gets blocked and a warning is logged if it contains the focused element.

These changes add a way for the container to indicate when it's done moving focus and use the new API to apply the aria-hidden.

Fixes #30187.

@crisbeto crisbeto requested a review from a team as a code owner May 5, 2025 12:55
@crisbeto crisbeto requested review from andrewseguin and wagnermaciel and removed request for a team May 5, 2025 12:55
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label May 5, 2025
@crisbeto crisbeto force-pushed the 30187/cdk-dialog-aria-hidden branch from 7bb6c91 to aedc30f Compare May 5, 2025 16:55
The dialog moves focus in an `afterRender`, because it needs to give the content some time to be rendered. This is problematic with some relatively recent behavior in Chrome where the `aria-hidden` gets blocked and a warning is logged if it contains the focused element.

These changes add a way for the container to indicate when it's done moving focus and use the new API to apply the `aria-hidden`.

Fixes angular#30187.
@crisbeto crisbeto force-pushed the 30187/cdk-dialog-aria-hidden branch from aedc30f to f930aaf Compare May 5, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/dialog target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(COMPONENT): Blocked aria-hidden on an element because its descendant retained focus.
1 participant