From c21aa91b292c343d106001fb80245589ff8210cc Mon Sep 17 00:00:00 2001 From: Konstantin Skok Date: Sun, 26 Mar 2023 16:21:51 +0300 Subject: [PATCH] fix(components/input): input text. clear --- .../input/input-text/input-text.component.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/libs/components/src/lib/components/input/input-text/input-text.component.ts b/libs/components/src/lib/components/input/input-text/input-text.component.ts index 0bd673fa1e..8cbfd5112b 100644 --- a/libs/components/src/lib/components/input/input-text/input-text.component.ts +++ b/libs/components/src/lib/components/input/input-text/input-text.component.ts @@ -223,7 +223,7 @@ export class PrizmInputTextComponent extends PrizmInputControl implement public clear(): void { if (this.disabled) return; - this.ngControl?.valueAccessor.writeValue(''); + this.ngControl?.control.setValue(''); this.touched = true; this._inputValue.value = ''; @@ -235,15 +235,7 @@ export class PrizmInputTextComponent extends PrizmInputControl implement this.stateChanges.next(); this.onClear.emit(); - this.valueChanged.next(this.value); - - this.elementRef.nativeElement.dispatchEvent( - new InputEvent('input', { - data: null, - detail: 0, - inputType: 'deleteContentBackward', - }) - ); + this.valueChanged.next(''); this.elementRef.nativeElement.dispatchEvent( new KeyboardEvent('keydown', {