Skip to content

Commit

Permalink
fix(platform): multi combobox bug where inputText is manipulated inco…
Browse files Browse the repository at this point in the history
…rrectly (#8793)
  • Loading branch information
mikerodonnell89 committed Oct 24, 2022
1 parent 8fb3acd commit d414003
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit d414003

Please sign in to comment.