Skip to content

Commit

Permalink
NAS-133431 / 25.04 / Fix how dirty status is updated in controls (#11308
Browse files Browse the repository at this point in the history
)

* NAS-133431: Fix how dirty status is updated in controls

* NAS-133431: PR update

* NAS-133431: PR update
  • Loading branch information
AlexKarpov98 authored Jan 9, 2025
1 parent 7619f19 commit 804f5d2
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export class IxInputComponent implements ControlValueAccessor, OnInit, OnChanges
showPassword = false;
invalid = false;
filteredOptions: Option[];
private lastKnownValue: string | number = this._value;

onChange: (value: string | number) => void = (): void => {};
onTouch: () => void = (): void => {};
Expand Down Expand Up @@ -152,11 +151,8 @@ export class IxInputComponent implements ControlValueAccessor, OnInit, OnChanges
});
}

registerOnChange(onChange: (value: string | number) => void): void {
this.onChange = (val) => {
this.lastKnownValue = val;
onChange(val);
};
registerOnChange(onChanged: () => void): void {
this.onChange = onChanged;
}

registerOnTouched(onTouched: () => void): void {
Expand Down Expand Up @@ -224,11 +220,6 @@ export class IxInputComponent implements ControlValueAccessor, OnInit, OnChanges
}
}

if (this.value !== this.lastKnownValue) {
this.lastKnownValue = this.value;
this.onChange(this.value);
}

if (this.autocompleteOptions() && !this.findExistingOption(this.value)) {
this.writeValue('');
this.onChange('');
Expand Down

0 comments on commit 804f5d2

Please sign in to comment.