Skip to content

Angular 20.3.x animate.leave is affected by MAT-ERROR tag leaving dom. #64065

@mattiLeBlanc

Description

@mattiLeBlanc

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

MAT-ERROR leaving the DOM is causing the parents animate.leave to be triggered. Reproduce by clicking in the code field without entering any value and trigger the error by clicking somewhere else.
Notice the red border of the error state and the error message appears.
Now focus again on text field and enter a value. The box will slide out because the mat-error removal will trigger the leave animation.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-kjtfldgb?file=src%2Fmain.ts

Please provide the exception or error you saw

You can only visually see this.

Please provide the environment you discovered this bug in (run ng version)

See stackblitz

Anything else?

No response

Metadata

Metadata

Labels

area: coreIssues related to the framework runtimecore: animationsIssues related to `animate.enter` and `animate.leave`state: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions