Skip to content

[Cherry pick] fix(cdk/dialog): avoid setting aria-hidden before focus has moved #31036

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented May 6, 2025

Cherry-picks #31030 into the patch branch.

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.

…gular#31030)

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 requested a review from devversion May 6, 2025 07:09
@crisbeto crisbeto requested a review from a team as a code owner May 6, 2025 07:09
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label May 6, 2025
@crisbeto crisbeto requested review from mmalerba and ok7sai and removed request for a team May 6, 2025 07:09
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label May 6, 2025
@crisbeto crisbeto removed request for mmalerba and ok7sai May 6, 2025 08:17
@crisbeto crisbeto merged commit 85e4486 into angular:19.2.x May 6, 2025
28 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker 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.

2 participants