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

Fixed #15197 #15198

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export class DropdownItem {
<input
#filter
type="text"
role="searchbox"
autocomplete="off"
[value]="_filterValue() || ''"
class="p-dropdown-filter p-inputtext p-component"
Expand Down Expand Up @@ -290,13 +291,13 @@ export class DropdownItem {
></p-dropdownItem>
</ng-container>
</ng-template>
<li *ngIf="filterValue && isEmpty()" class="p-dropdown-empty-message" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="presentation">
<li *ngIf="filterValue && isEmpty()" class="p-dropdown-empty-message" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="option">
<ng-container *ngIf="!emptyFilterTemplate && !emptyTemplate; else emptyFilter">
{{ emptyFilterMessageLabel }}
</ng-container>
<ng-container #emptyFilter *ngTemplateOutlet="emptyFilterTemplate || emptyTemplate"></ng-container>
</li>
<li *ngIf="!filterValue && isEmpty()" class="p-dropdown-empty-message" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="presentation">
<li *ngIf="!filterValue && isEmpty()" class="p-dropdown-empty-message" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="option">
<ng-container *ngIf="!emptyTemplate; else empty">
{{ emptyMessageLabel }}
</ng-container>
Expand Down
17 changes: 11 additions & 6 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const MULTISELECT_VALUE_ACCESSOR: any = {
template: `
<li
pRipple
role='option'
role="option"
[ngStyle]="{ height: itemSize + 'px' }"
class="p-multiselect-item"
[ngClass]="{ 'p-multiselect-item': true, 'p-highlight': selected, 'p-disabled': disabled, 'p-focus': focused }"
Expand Down Expand Up @@ -217,7 +217,6 @@ export class MultiSelectItem {
<span
#firstHiddenFocusableEl
role="presentation"
[attr.aria-hidden]="'true'"
class="p-hidden-accessible p-hidden-focusable"
[attr.tabindex]="0"
(focus)="onFirstHiddenFocus($event)"
Expand Down Expand Up @@ -251,7 +250,13 @@ export class MultiSelectItem {
[attr.aria-label]="toggleAllAriaLabel"
/>
</div>
<div class="p-checkbox-box" role="checkbox" [attr.aria-label]="toggleAllAriaLabel" [attr.aria-checked]="allSelected()" [ngClass]="{ 'p-highlight': allSelected(), 'p-focus': headerCheckboxFocus, 'p-disabled': disabled || toggleAllDisabled }">
<div
class="p-checkbox-box"
role="checkbox"
[attr.aria-label]="toggleAllAriaLabel"
[attr.aria-checked]="allSelected()"
[ngClass]="{ 'p-highlight': allSelected(), 'p-focus': headerCheckboxFocus, 'p-disabled': disabled || toggleAllDisabled }"
>
<ng-container *ngIf="allSelected()">
<CheckIcon [styleClass]="'p-checkbox-icon'" *ngIf="!checkIconTemplate" [attr.aria-hidden]="true" />
<span *ngIf="checkIconTemplate" class="p-checkbox-icon" [attr.aria-hidden]="true">
Expand All @@ -264,6 +269,7 @@ export class MultiSelectItem {
<input
#filterInput
type="text"
role="searchbox"
[attr.autocomplete]="autocomplete"
[attr.placeholder]="filterPlaceHolder"
role="searchbox"
Expand Down Expand Up @@ -347,13 +353,13 @@ export class MultiSelectItem {
</ng-container>
</ng-template>

<li *ngIf="hasFilter() && isEmpty()" class="p-multiselect-empty-message" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }">
<li *ngIf="hasFilter() && isEmpty()" class="p-multiselect-empty-message" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="option">
<ng-container *ngIf="!emptyFilterTemplate && !emptyTemplate; else emptyFilter">
{{ emptyFilterMessageLabel }}
</ng-container>
<ng-container #emptyFilter *ngTemplateOutlet="emptyFilterTemplate || emptyTemplate"></ng-container>
</li>
<li *ngIf="!hasFilter() && isEmpty()" class="p-multiselect-empty-message" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }">
<li *ngIf="!hasFilter() && isEmpty()" class="p-multiselect-empty-message" [ngStyle]="{ height: scrollerOptions.itemSize + 'px' }" role="option">
<ng-container *ngIf="!emptyTemplate; else empty">
{{ emptyMessageLabel }}
</ng-container>
Expand All @@ -370,7 +376,6 @@ export class MultiSelectItem {
<span
#lastHiddenFocusableEl
role="presentation"
[attr.aria-hidden]="true"
class="p-hidden-accessible p-hidden-focusable"
[attr.tabindex]="0"
(focus)="onLastHiddenFocus($event)"
Expand Down
Loading