Skip to content

Commit ef0974e

Browse files
committed
fix: use FormArray.length instead of value?.length to handle disabled controls
1 parent 977d043 commit ef0974e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/app/shared/form/form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ export class FormComponent implements OnDestroy, OnInit {
368368
// In case of qualdrop value remove event must be dispatched before removing the control from array
369369
this.removeArrayItem.emit(event);
370370
}
371-
if (index === 0 && formArrayControl.value?.length === 1) {
371+
if (index === 0 && formArrayControl.length === 1) {
372372
// Don't remove the last item, just clear its value to prevent the array from becoming empty
373373
event.model = cloneDeep(event.model);
374374
const fieldId = event.model.id;

0 commit comments

Comments
 (0)