-
Notifications
You must be signed in to change notification settings - Fork 556
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
formArray's valueChange is not triggered when the length is decreasing #3250
Labels
Comments
aitboudad
added a commit
to aitboudad/ngx-formly
that referenced
this issue
Apr 22, 2022
aitboudad
added a commit
that referenced
this issue
Apr 22, 2022
This issue has been fixed and released as part of v5.12.1 release. Please let us know, in case you are still encountering a similar issue/problem. |
This was referenced Apr 28, 2022
Closed
This was referenced Jul 19, 2022
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When you change the length of a fieldArray, the valueChange observable associated to the formArray control is only triggered when the count is increasing but not when the length decrease.
Minimal Reproduction
https://stackblitz.com/edit/angular-7mcxsf?file=src/app/app.component.ts
Change the count from 3 to 4, 4 to 5, you will see in the console that the valueChange is triggered accordingly.
But when you set the counter from 5 to 4 and 4 to 3, nothing happens in the console.
Workaround
Just after setting the new model, you can put this:
The problem is that the valueChange will be triggered 2 times when increasing the count (even when using distinctUntilChanged)
Your Environment
The text was updated successfully, but these errors were encountered: