description field set comment ui fix

This commit is contained in:
CITE\amentis 2024-10-04 16:26:50 +03:00
parent 9f22d3742a
commit fd5bcb3c08
1 changed files with 4 additions and 0 deletions

View File

@ -114,9 +114,13 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
deleteMultiplicityField(fieldSetIndex: number): void { deleteMultiplicityField(fieldSetIndex: number): void {
const formArray = this.propertiesFormGroup.get('items') as UntypedFormArray; const formArray = this.propertiesFormGroup.get('items') as UntypedFormArray;
const fieldSetToDelete = formArray.at(fieldSetIndex) as UntypedFormGroup;
// store comment to display
const comment = fieldSetToDelete.get('comment').value || null;
formArray.removeAt(fieldSetIndex); formArray.removeAt(fieldSetIndex);
formArray.controls.forEach((fieldSet, index) => { formArray.controls.forEach((fieldSet, index) => {
fieldSet.get('ordinal').setValue(index); fieldSet.get('ordinal').setValue(index);
fieldSet.get('comment').setValue(comment);
}); });
//Reapply validators //Reapply validators