diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index d2b249e923d..3eb2e472c04 100755 --- a/src/app/components/autocomplete/autocomplete.ts +++ b/src/app/components/autocomplete/autocomplete.ts @@ -81,8 +81,8 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = { [attr.aria-label]="ariaLabel" [attr.aria-labelledby]="ariaLabelledBy" [attr.aria-required]="required" - [attr.aria-expanded]="overlayVisible" - [attr.aria-controls]="id + '_list'" + [attr.aria-expanded]="overlayVisible ?? false" + [attr.aria-controls]="overlayVisible ? id + '_list' : null" [attr.aria-aria-activedescendant]="focused ? focusedOptionId : undefined" (input)="onInput($event)" (keydown)="onKeyDown($event)" @@ -155,8 +155,8 @@ export const AUTOCOMPLETE_VALUE_ACCESSOR: any = { [attr.aria-label]="ariaLabel" [attr.aria-labelledby]="ariaLabelledBy" [attr.aria-required]="required" - [attr.aria-expanded]="overlayVisible" - [attr.aria-controls]="id + '_list'" + [attr.aria-expanded]="overlayVisible ?? false" + [attr.aria-controls]="overlayVisible ? id + '_list' : null" [attr.aria-aria-activedescendant]="focused ? focusedOptionId : undefined" (input)="onInput($event)" (keydown)="onKeyDown($event)" diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index ce28618cce4..1f7a81af1e2 100755 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -73,8 +73,8 @@ export const CALENDAR_VALUE_ACCESSOR: any = { [attr.aria-required]="required" aria-autocomplete="none" aria-haspopup="dialog" - [attr.aria-expanded]="overlayVisible" - [attr.aria-controls]="panelId" + [attr.aria-expanded]="overlayVisible ?? false" + [attr.aria-controls]="overlayVisible ? panelId : null" [attr.aria-labelledby]="ariaLabelledBy" [attr.aria-label]="ariaLabel" [value]="inputFieldValue" @@ -103,8 +103,8 @@ export const CALENDAR_VALUE_ACCESSOR: any = { type="button" [attr.aria-label]="iconButtonAriaLabel" aria-haspopup="dialog" - [attr.aria-expanded]="overlayVisible" - [attr.aria-controls]="panelId" + [attr.aria-expanded]="overlayVisible ?? false" + [attr.aria-controls]="overlayVisible ? panelId : null" pButton pRipple *ngIf="showIcon && iconDisplay === 'button'" diff --git a/src/app/components/cascadeselect/cascadeselect.ts b/src/app/components/cascadeselect/cascadeselect.ts index cee7c80b204..f24d8fe4cb5 100755 --- a/src/app/components/cascadeselect/cascadeselect.ts +++ b/src/app/components/cascadeselect/cascadeselect.ts @@ -243,8 +243,8 @@ export class CascadeSelectSub implements OnInit { [attr.aria-label]="ariaLabel" [attr.aria-labelledby]="ariaLabelledBy" aria-haspopup="tree" - [attr.aria-expanded]="overlayVisible" - [attr.aria-controls]="id + '_tree'" + [attr.aria-expanded]="overlayVisible ?? false" + [attr.aria-controls]="overlayVisible ? id + '_tree' : null" [attr.aria-activedescendant]="focused ? focusedOptionId : undefined" (focus)="onInputFocus($event)" (blur)="onInputBlur($event)" @@ -267,7 +267,7 @@ export class CascadeSelectSub implements OnInit { -