Fix edit lists behaving wrong
This commit is contained in:
parent
a9cf6dc286
commit
c36123a58f
2 changed files with 3 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
<form [formGroup]="form" *transloco="let t">
|
<form [formGroup]="form" *transloco="let t">
|
||||||
<div formArrayName="items">
|
<div formArrayName="items">
|
||||||
@for(item of ItemsArray.controls; let i = $index; track i) {
|
<!-- We are tracking items, as the index will not always point towards the same item. -->
|
||||||
|
@for(item of ItemsArray.controls; let i = $index; track item) {
|
||||||
<div class="row g-0 mb-3">
|
<div class="row g-0 mb-3">
|
||||||
<div class="col-lg-10 col-md-12 pe-2">
|
<div class="col-lg-10 col-md-12 pe-2">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ export class EditListComponent implements OnInit {
|
||||||
if (this.ItemsArray.length === 1) {
|
if (this.ItemsArray.length === 1) {
|
||||||
this.ItemsArray.at(0).setValue('');
|
this.ItemsArray.at(0).setValue('');
|
||||||
this.emit();
|
this.emit();
|
||||||
|
this.cdRef.markForCheck();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue