From f00c79bff9505557330f891f37f12aff1901d410 Mon Sep 17 00:00:00 2001 From: Axel Lorens Date: Thu, 14 Nov 2024 09:50:10 -0800 Subject: [PATCH] update planet tag --- .../shared/forms/planet-tag-input-dialog.component.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/shared/forms/planet-tag-input-dialog.component.ts b/src/app/shared/forms/planet-tag-input-dialog.component.ts index 6c335053c1..dadf58f61e 100644 --- a/src/app/shared/forms/planet-tag-input-dialog.component.ts +++ b/src/app/shared/forms/planet-tag-input-dialog.component.ts @@ -203,6 +203,7 @@ export class PlanetTagInputDialogComponent { this.data.initTags(); this.deleteDialog.close(); this.planetMessageService.showMessage($localize`Tag deleted: ${tag.name}`); + this.resetValidationAndCheck(this.addTagForm); }, onError: (error) => this.planetMessageService.showAlert($localize`There was a problem deleting this tag.`) }; @@ -230,6 +231,15 @@ export class PlanetTagInputDialogComponent { ); } + resetValidationAndCheck(form: FormGroup) { + Object.keys(form.controls).forEach(key => { + const control = form.get(key); + control?.clearValidators(); + control?.markAsUntouched(); + control?.updateValueAndValidity(); + }); + } + toggleSubcollection(event, tagId) { event.stopPropagation(); const newState = !this.subcollectionIsOpen.get(tagId);