From bb80943477c296aa5b5b5479dc4aa53e70077a2f Mon Sep 17 00:00:00 2001 From: Shahar Kazaz Date: Mon, 17 Jul 2023 08:48:09 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20error=20class=20not=20rem?= =?UTF-8?q?oved?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ngneat/error-tailor/src/lib/control-error.directive.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/ngneat/error-tailor/src/lib/control-error.directive.ts b/projects/ngneat/error-tailor/src/lib/control-error.directive.ts index 22ab6d9..9b1749d 100644 --- a/projects/ngneat/error-tailor/src/lib/control-error.directive.ts +++ b/projects/ngneat/error-tailor/src/lib/control-error.directive.ts @@ -147,7 +147,7 @@ export class ControlErrorsDirective implements OnInit, OnDestroy { const hasErrors = !!this.control.errors; if (hasErrors) { this.showError(); - } else if (this.ref) { + } else { this.hideError(); } }); @@ -202,7 +202,9 @@ export class ControlErrorsDirective implements OnInit, OnDestroy { */ hideError(): void { this.removeCustomClass(); - this.setError(null); + if (this.ref) { + this.setError(null); + } } ngOnDestroy() {