From 16b6a34d25608ec50e195159db9978046b55eda9 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 15 Nov 2023 16:13:45 +0200 Subject: [PATCH] [angular-16-irish-monitor]: Fix input reset value on changes --- sharedComponents/input/input.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index cfcae9d5..df298e09 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -478,7 +478,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang ngOnChanges(changes: SimpleChanges) { if (this.formControl) { - if (changes.value) { + if (changes.value && changes.value.currentValue !== changes.value.previousValue) { this.formControl.setValue(this.value); } if (changes.validators) { @@ -826,6 +826,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang resetValue(event: any) { event.stopPropagation(); + console.log(1) this.formControl.setValue(''); this.focus(true, event); }