1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

[PM-2135] feat: hack mark as touched to get error to display

This commit is contained in:
Andreas Coroiu
2023-05-05 14:40:10 +02:00
parent f69b42a622
commit 8ebaff3612
2 changed files with 11 additions and 2 deletions

View File

@@ -78,9 +78,15 @@ export class BitInputDirective implements BitFormFieldControl {
return this.id;
}
private isActive = true;
@HostListener("blur")
onBlur() {
this.isActive = true;
}
@HostListener("input")
onInput() {
this.ngControl?.control?.markAsUntouched();
this.isActive = false;
}
get hasError() {
@@ -91,7 +97,7 @@ export class BitInputDirective implements BitFormFieldControl {
this.ngControl?.errors != null
);
} else {
return this.ngControl?.status === "INVALID" && this.ngControl?.touched;
return this.ngControl?.status === "INVALID" && this.ngControl?.touched && this.isActive;
}
}