question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FormArray is incorrectly pristine

See original GitHub issue

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

forms

Is this a regression?

Yes

Description

I have a FormArray containing a FormGroup containing a FormControl. When a FormControl is edited (by the user through an input), the FormGroup is correctly set as dirty, but the FormArray incorrectly stays pristine.

Please provide a link to a minimal reproduction of the bug

https://embed.plnkr.co/plunk/MemMp3sni5MEtdSV

Please provide the exception or error you saw

No response

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

Angular CLI: 12.2.2
Node: 14.19.1
Package Manager: npm 
OS: linux x64

Angular: 12.2.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.2
@angular-devkit/build-angular   12.2.2
@angular-devkit/core            12.2.2
@angular-devkit/schematics      12.2.2
@angular/cdk                    10.2.7
@angular/flex-layout            12.0.0-beta.34
@angular/google-maps            12.2.11
@angular/material               10.2.7
@schematics/angular             12.2.2
rxjs                            6.6.7
typescript                      4.3.5

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dylhunncommented, May 5, 2022

adding a setter might be the right choice here

I’m sort of inclined to agree, but it’s going to cause massive breakage unfortunately. The docs we can fix though.

0reactions
angular-automatic-lock-bot[bot]commented, Jun 5, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reactive Forms: modifying a FormArray does not flip dirty ...
When the FormArray is updated via the interface, the control in the FormArray is marked dirty yet the FormGroup remains pristine. @cbaltrinic We ......
Read more >
Angular Reactive Froms, Getting Pristine of nested control
I am creating a fairly simple nested form. Form Group > Form Array > Form Group > Controls. In ...
Read more >
FormArray
Resets the FormArray and all descendants are marked pristine and untouched , and the value of all descendants to null or null maps....
Read more >
Angular Reactive Form - Part 4 / 4 - Form Array / Dynamic ...
Welcome to part 4 of the reactive form tutorial.In the past lecture, we have seen how to capture form data and validate or...
Read more >
A thorough exploration of Angular Forms
FG - FormGroup // FA - FormArray // FC - FormControl FG / \ FC FG / \ FC FA ... (f: FormGroup):...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found