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

fix(material/select): overlay not detached on time after exit animation in some cases #30456

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 7, 2025

Fixes an issue that was reported internally where in some setups the select would animate away, but wouldn't be detached after the exit animation until the next change detection.

@crisbeto crisbeto added the target: minor This PR is targeted for the next minor release label Feb 7, 2025
@crisbeto crisbeto requested a review from a team as a code owner February 7, 2025 13:02
@crisbeto crisbeto requested review from mmalerba and wagnermaciel and removed request for a team February 7, 2025 13:02
this._overlayDir.detachOverlay();
// Some of the overlay detachment logic depends on change detection.
// Mark for check to ensure that things get picked up in a timely manner.
this._changeDetectorRef.markForCheck();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main part of the fix. The rest is removing the runOutsideAngular call, because marking for check outside the zone used to be problematic, not sure if that's the case anymore but am playing it safe.

…on in some cases

Fixes an issue that was reported internally where in some setups the select would animate away, but wouldn't be detached after the exit animation until the next change detection.
@crisbeto crisbeto force-pushed the select-animation-glitch branch from 3d5df1d to b3d04dc Compare February 7, 2025 13:07
@crisbeto crisbeto requested a review from andrewseguin February 7, 2025 13:09
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Feb 10, 2025
@crisbeto crisbeto merged commit 24c2567 into angular:main Feb 10, 2025
20 of 22 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: material/select target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants