Skip to content

fix(forms): inserting and removing controls should work in re-bound f… #21822

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

Closed
wants to merge 1 commit into from

Conversation

kara
Copy link
Contributor

@kara kara commented Jan 27, 2018

…orm arrays

Closes #21501

In brief: there was a problem with calling FormArray.removeAt() and FormArray.insert() after a FormArray was replaced with setControl. The collection changes calls would cause the directives to update too early, which caused form controls to be saved at the wrong offset. So on submit, some controls were not defined. Since the directives correct themselves on removal, the collection changes calls were unnecessary.

@kara kara added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 27, 2018
@kara kara requested a review from tinayuangao January 27, 2018 03:34
@kara kara added area: forms PR target: patch-only target: patch This PR is targeted for the next patch release and removed PR target: patch-only labels Jan 27, 2018
@mary-poppins
Copy link

You can preview 759439e at https://pr21822-759439e.ngbuilds.io/.

Copy link
Contributor

@tinayuangao tinayuangao left a comment

Choose a reason for hiding this comment

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

LGTM

@kara kara added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 29, 2018
@jasonaden jasonaden added action: merge The PR is ready for merge by the caretaker and removed action: merge The PR is ready for merge by the caretaker labels Jan 29, 2018
@jasonaden
Copy link
Contributor

Presubmit

jasonaden pushed a commit that referenced this pull request Jan 30, 2018
@jasonaden jasonaden closed this in b4cd279 Jan 30, 2018
jbogarthyde pushed a commit to jbogarthyde/angular that referenced this pull request Feb 23, 2018
leo6104 pushed a commit to leo6104/angular that referenced this pull request Mar 25, 2018
@kara kara deleted the arrays branch October 13, 2018 01:09
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: forms cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove item from FormArray causes the exception on submit
5 participants