Skip to content

Commit

Permalink
set validators back up after clearing validators
Browse files Browse the repository at this point in the history
  • Loading branch information
RheuX committed Nov 18, 2024
1 parent f00c79b commit 979318c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/shared/forms/planet-tag-input-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ export class PlanetTagInputDialogComponent {
Object.keys(form.controls).forEach(key => {
const control = form.get(key);
control?.clearValidators();

if (key === 'name') {
control?.setValidators(this.tagNameSyncValidator());
control?.setAsyncValidators(ac => this.tagNameAsyncValidator(ac));
}

control?.markAsUntouched();
control?.updateValueAndValidity();
});
Expand Down

0 comments on commit 979318c

Please sign in to comment.