ngx-formly / ngx-formly

📝 JSON powered / Dynamic forms for Angular
https://formly.dev
MIT License
2.81k stars 566 forks source link

Duplication artifacts during Angular animation when using formly form with a custom type. #3515

Open dot-tb opened 1 year ago

dot-tb commented 1 year ago

Description

When animating a formly form using Angular's animations, if the form is built using a custom type, using the ":leave" animation query will cause an unexpected behaviour.

When the component is loaded into the view, multiple instances of the custom type will be seen playing the :leave animation.

Minimal Reproduction

https://stackblitz.com/edit/angular-ivy-w2atun

Your Environment

dot-tb commented 1 year ago

Found a simple temporary css fix, making the custom type to only display when inside a formly-form tag :

formly-show-password {
  display: none;
}

formly-form formly-show-password {
  display: block;
}