Skip to content

Commit

Permalink
Merge pull request #16398 from Dive576/issue-16397
Browse files Browse the repository at this point in the history
Fixes #16397: Removed aria-hidden attribute from ContextMenu, Dock, and MegaMenu
  • Loading branch information
cetincakiroglu authored Sep 26, 2024
2 parents 5263cd2 + cd69456 commit e0f2d9e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
12 changes: 4 additions & 8 deletions src/app/components/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils';
<a
*ngIf="!getItemProp(processedItem, 'routerLink')"
[attr.href]="getItemProp(processedItem, 'url')"
[attr.aria-hidden]="true"
[attr.data-automationid]="getItemProp(processedItem, 'automationId')"
[attr.data-pc-section]="'action'"
[target]="getItemProp(processedItem, 'target')"
Expand All @@ -108,7 +107,6 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils';
[ngClass]="getItemProp(processedItem, 'icon')"
[ngStyle]="getItemProp(processedItem, 'iconStyle')"
[attr.data-pc-section]="'icon'"
[attr.aria-hidden]="true"
[attr.tabindex]="-1"
>
</span>
Expand All @@ -121,16 +119,15 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils';
<span class="p-menuitem-badge" *ngIf="getItemProp(processedItem, 'badge')" [ngClass]="getItemProp(processedItem, 'badgeStyleClass')">{{ getItemProp(processedItem, 'badge') }}</span>
<ng-container *ngIf="isItemGroup(processedItem)">
<AngleRightIcon *ngIf="!contextMenu.submenuIconTemplate" [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" [attr.aria-hidden]="true" />
<ng-template *ngTemplateOutlet="contextMenu.submenuIconTemplate" [attr.data-pc-section]="'submenuicon'" [attr.aria-hidden]="true"></ng-template>
<AngleRightIcon *ngIf="!contextMenu.submenuIconTemplate" [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" />
<ng-template *ngTemplateOutlet="contextMenu.submenuIconTemplate" [attr.data-pc-section]="'submenuicon'"></ng-template>
</ng-container>
</a>
<a
*ngIf="getItemProp(processedItem, 'routerLink')"
[routerLink]="getItemProp(processedItem, 'routerLink')"
[attr.data-automationid]="getItemProp(processedItem, 'automationId')"
[attr.tabindex]="-1"
[attr.aria-hidden]="true"
[attr.data-pc-section]="'action'"
[queryParams]="getItemProp(processedItem, 'queryParams')"
[routerLinkActive]="'p-menuitem-link-active'"
Expand All @@ -151,7 +148,6 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils';
[ngClass]="getItemProp(processedItem, 'icon')"
[ngStyle]="getItemProp(processedItem, 'iconStyle')"
[attr.data-pc-section]="'icon'"
[attr.aria-hidden]="true"
[attr.tabindex]="-1"
>
</span>
Expand All @@ -164,8 +160,8 @@ import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils';
<span class="p-menuitem-badge" *ngIf="getItemProp(processedItem, 'badge')" [ngClass]="getItemProp(processedItem, 'badgeStyleClass')">{{ getItemProp(processedItem, 'badge') }}</span>
<ng-container *ngIf="isItemGroup(processedItem)">
<AngleRightIcon *ngIf="!contextMenu.submenuIconTemplate" [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" [attr.aria-hidden]="true" />
<ng-template *ngTemplateOutlet="contextMenu.submenuIconTemplate" [attr.data-pc-section]="'submenuicon'" [attr.aria-hidden]="true"></ng-template>
<AngleRightIcon *ngIf="!contextMenu.submenuIconTemplate" [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" />
<ng-template *ngTemplateOutlet="contextMenu.submenuIconTemplate" [attr.data-pc-section]="'submenuicon'"></ng-template>
</ng-container>
</a>
</ng-container>
Expand Down
2 changes: 0 additions & 2 deletions src/app/components/dock/dock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import { DomHandler } from 'primeng/dom';
[skipLocationChange]="item.skipLocationChange"
[replaceUrl]="item.replaceUrl"
[state]="item.state"
[attr.aria-hidden]="true"
>
<span class="p-dock-action-icon" *ngIf="item.icon && !itemTemplate" [ngClass]="item.icon" [ngStyle]="item.iconStyle"></span>
<ng-container *ngTemplateOutlet="itemTemplate; context: { $implicit: item }"></ng-container>
Expand All @@ -80,7 +79,6 @@ import { DomHandler } from 'primeng/dom';
[ngClass]="{ 'p-disabled': item.disabled }"
[target]="item.target"
[attr.tabindex]="item.disabled || (i !== activeIndex && readonly) ? null : item.tabindex ? item.tabindex : '-1'"
[attr.aria-hidden]="true"
>
<span class="p-dock-action-icon" *ngIf="item.icon && !itemTemplate" [ngClass]="item.icon" [ngStyle]="item.iconStyle"></span>
<ng-container *ngTemplateOutlet="itemTemplate; context: { $implicit: item }"></ng-container>
Expand Down
14 changes: 6 additions & 8 deletions src/app/components/megamenu/megamenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,17 @@ import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
<ng-container *ngIf="isItemGroup(processedItem)">
<ng-container *ngIf="!megaMenu.submenuIconTemplate">
<AngleDownIcon [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" *ngIf="orientation === 'horizontal'" [attr.aria-hidden]="true" />
<AngleRightIcon [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" *ngIf="orientation === 'vertical'" [attr.aria-hidden]="true" />
<AngleDownIcon [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" *ngIf="orientation === 'horizontal'" />
<AngleRightIcon [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" *ngIf="orientation === 'vertical'" />
</ng-container>
<ng-template *ngTemplateOutlet="megaMenu.submenuIconTemplate" [attr.data-pc-section]="'submenuicon'" [attr.aria-hidden]="true"></ng-template>
<ng-template *ngTemplateOutlet="megaMenu.submenuIconTemplate" [attr.data-pc-section]="'submenuicon'"></ng-template>
</ng-container>
</a>
<a
*ngIf="getItemProp(processedItem, 'routerLink')"
[routerLink]="getItemProp(processedItem, 'routerLink')"
[attr.data-automationid]="getItemProp(processedItem, 'automationId')"
[attr.tabindex]="-1"
[attr.aria-hidden]="true"
[attr.data-pc-section]="'action'"
[queryParams]="getItemProp(processedItem, 'queryParams')"
[routerLinkActive]="'p-menuitem-link-active'"
Expand All @@ -147,18 +146,17 @@ import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
[ngClass]="getItemProp(processedItem, 'icon')"
[ngStyle]="getItemProp(processedItem, 'iconStyle')"
[attr.data-pc-section]="'icon'"
[attr.aria-hidden]="true"
[attr.tabindex]="-1"
></span>
<span class="p-menuitem-text" *ngIf="getItemProp(processedItem, 'escape'); else htmlRouteLabel">{{ getItemLabel(processedItem) }}</span>
<ng-template #htmlRouteLabel><span class="p-menuitem-text" [innerHTML]="getItemLabel(processedItem)" [attr.data-pc-section]="'label'"></span></ng-template>
<span class="p-menuitem-badge" *ngIf="getItemProp(processedItem, 'badge')" [ngClass]="getItemProp(processedItem, 'badgeStyleClass')">{{ getItemProp(processedItem, 'badge') }}</span>
<ng-container *ngIf="isItemGroup(processedItem)">
<ng-container *ngIf="!megaMenu.submenuIconTemplate">
<AngleDownIcon [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" *ngIf="orientation === 'horizontal'" [attr.aria-hidden]="true" />
<AngleRightIcon [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" *ngIf="orientation === 'vertical'" [attr.aria-hidden]="true" />
<AngleDownIcon [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" *ngIf="orientation === 'horizontal'" />
<AngleRightIcon [styleClass]="'p-submenu-icon'" [attr.data-pc-section]="'submenuicon'" *ngIf="orientation === 'vertical'" />
</ng-container>
<ng-template *ngTemplateOutlet="megaMenu.submenuIconTemplate" [attr.data-pc-section]="'submenuicon'" [attr.aria-hidden]="true"></ng-template>
<ng-template *ngTemplateOutlet="megaMenu.submenuIconTemplate" [attr.data-pc-section]="'submenuicon'"></ng-template>
</ng-container>
</a>
</ng-container>
Expand Down

0 comments on commit e0f2d9e

Please sign in to comment.