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(platform): multi combobox bug where inputText is manipulated incorrectly #8793

Merged
merged 1 commit into from
Oct 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ export abstract class BaseMultiCombobox extends CollectionBaseInput implements O
/** @hidden */
private _inputTextValue: string;

/** @hidden */
private _previousInputText: string;

/** @hidden */
private _matchingStrategy: MatchingStrategy = this.multiComboboxConfig.matchingStrategy;

Expand Down Expand Up @@ -387,6 +390,7 @@ export abstract class BaseMultiCombobox extends CollectionBaseInput implements O
ngAfterViewInit(): void {
this._initWindowResize();
this._assignCustomTemplates();
this._previousInputText = this.inputText;
super.ngAfterViewInit();
}

Expand Down Expand Up @@ -681,6 +685,8 @@ export abstract class BaseMultiCombobox extends CollectionBaseInput implements O
this._processingEmptyData();

return;
} else {
this._previousInputText = this.inputText;
}

this._suggestions = this._convertToOptionItems(data).map((optionItem: SelectableOptionItem) => {
Expand Down Expand Up @@ -748,7 +754,9 @@ export abstract class BaseMultiCombobox extends CollectionBaseInput implements O

/** @hidden */
private _processingEmptyData(): void {
this.inputText = this.inputText.slice(0, -1);
this._cd.detectChanges();

this.inputText = this._previousInputText;

this._setInvalidEntry();

Expand Down