Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix update cps-autocomplete component value #408

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,8 @@ export class CpsAutocompleteComponent

onBlur() {
if (!this.isOpened) {
this._closeAndClear();
this._confirmInput(this.inputText || '', false);
}

this._checkErrors();
this.blurred.emit();
}
Expand Down Expand Up @@ -971,7 +970,10 @@ export class CpsAutocompleteComponent
searchVal = searchVal.toLowerCase();
if (!searchVal) {
if (this.multiple) return;
this.updateValue(this._getEmptyValue());
// Only reset the value if the inputText was changed by the user
if (this.inputText !== this._getValueLabel()) {
this.updateValue(this._getEmptyValue());
}
this.cdRef.detectChanges();
this._closeAndClear();
return;
Expand Down
Loading