Skip to content

Commit

Permalink
safely check suggestions length
Browse files Browse the repository at this point in the history
  • Loading branch information
qwadrox committed Dec 19, 2024
1 parent 2d0f527 commit 1cdebbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/primeng/src/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ export class AutoComplete extends BaseComponent implements AfterViewChecked, Aft

handleSuggestionsChange() {
if (this.loading) {
this._suggestions().length > 0 || this.showEmptyMessage || !!this.emptyTemplate ? this.show() : this.hide();
this._suggestions()?.length > 0 || this.showEmptyMessage || !!this.emptyTemplate ? this.show() : this.hide();
const focusedOptionIndex = this.overlayVisible && this.autoOptionFocus ? this.findFirstFocusedOptionIndex() : -1;
this.focusedOptionIndex.set(focusedOptionIndex);
this.suggestionsUpdated = true;
Expand Down

0 comments on commit 1cdebbf

Please sign in to comment.