Skip to content

Commit

Permalink
Fixes primefaces#15112 - Give list role instead of listbox to items l…
Browse files Browse the repository at this point in the history
…ist when empty
  • Loading branch information
mlz11 committed Mar 25, 2024
1 parent 7e17d57 commit 68d1f1d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
Renderer2,
Signal,
signal,
SimpleChanges,
TemplateRef,
ViewChild,
ViewEncapsulation,
Expand Down Expand Up @@ -266,7 +265,15 @@ export class DropdownItem {
</ng-container>
<ng-template #buildInItems let-items let-scrollerOptions="options">
<ul #items [attr.id]="id + '_list'" [attr.aria-label]="listLabel" class="p-dropdown-items" [ngClass]="scrollerOptions.contentStyleClass" [style]="scrollerOptions.contentStyle" role="listbox">
<ul
#items
[attr.id]="id + '_list'"
[attr.aria-label]="listLabel"
class="p-dropdown-items"
[ngClass]="scrollerOptions.contentStyleClass"
[style]="scrollerOptions.contentStyle"
[attr.role]="isEmpty() ? 'list' : 'listbox'"
>
<ng-template ngFor let-option [ngForOf]="items" let-i="index">
<ng-container *ngIf="isOptionGroup(option)">
<li class="p-dropdown-item-group" [attr.id]="id + '_' + getOptionIndex(i, scrollerOptions)" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="option">
Expand Down

0 comments on commit 68d1f1d

Please sign in to comment.