Skip to content

Commit

Permalink
fix(components/input): input text. clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Skok committed Mar 27, 2023
1 parent bfc2048 commit c21aa91
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class PrizmInputTextComponent extends PrizmInputControl<string> implement
public clear(): void {
if (this.disabled) return;

this.ngControl?.valueAccessor.writeValue('');
this.ngControl?.control.setValue('');
this.touched = true;

this._inputValue.value = '';
Expand All @@ -235,15 +235,7 @@ export class PrizmInputTextComponent extends PrizmInputControl<string> 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', {
Expand Down

0 comments on commit c21aa91

Please sign in to comment.