Skip to content

Commit

Permalink
Empty autocomplete results not shown as empty html list
Browse files Browse the repository at this point in the history
  • Loading branch information
kra committed Feb 7, 2024
1 parent 9b3c6f2 commit 94d152c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = {
</ng-container>
<ng-template #buildInItems let-items let-scrollerOptions="options">
<ul #items class="p-autocomplete-items" [ngClass]="scrollerOptions.contentStyleClass" [style]="scrollerOptions.contentStyle" role="listbox" [attr.id]="id + '_list'">
<ul #resultItems *ngIf="items.length !== 0" class="p-autocomplete-items" [ngClass]="scrollerOptions.contentStyleClass" [style]="scrollerOptions.contentStyle" role="listbox" [attr.id]="id + '_list'">
<ng-template ngFor let-option [ngForOf]="items" let-i="index">
<ng-container *ngIf="isOptionGroup(option)">
<li [attr.id]="id + '_' + getOptionIndex(i, scrollerOptions)" class="p-autocomplete-item-group" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="option">
Expand Down Expand Up @@ -681,7 +681,7 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr

@ViewChild('ddBtn') dropdownButton: Nullable<ElementRef>;

@ViewChild('items') itemsViewChild: Nullable<ElementRef>;
@ViewChild('resultItems') itemsViewChild: Nullable<ElementRef>;

@ViewChild('scroller') scroller: Nullable<Scroller>;

Expand Down

0 comments on commit 94d152c

Please sign in to comment.