diff --git a/src/app/components/menubar/menubar.ts b/src/app/components/menubar/menubar.ts index b654a225a1c..71fc8451e46 100755 --- a/src/app/components/menubar/menubar.ts +++ b/src/app/components/menubar/menubar.ts @@ -64,7 +64,7 @@ export class MenubarService { [attr.aria-label]="ariaLabel" [attr.aria-labelledBy]="ariaLabelledBy" (keydown)="menuKeydown.emit($event)" - [attr.id]="menuId" + [attr.id]="root ? menuId : null" [attr.aria-activedescendant]="focusedItemId" > @@ -121,11 +121,11 @@ export class MenubarService { [attr.tabindex]="-1" > - + {{ getItemLabel(processedItem) }} - + {{ getItemProp(processedItem, 'badge') }} @@ -192,6 +192,7 @@ export class MenubarService { [activeItemPath]="activeItemPath" [focusedItemId]="focusedItemId" [level]="level + 1" + [ariaLabelledBy]="getItemLabelId(processedItem)" (itemClick)="itemClick.emit($event)" (itemMouseEnter)="onItemMouseEnter($event)" > @@ -273,6 +274,10 @@ export class MenubarSub implements OnInit, OnDestroy { return this.getItemId(processedItem); } + getItemLabelId(processedItem: any): string { + return `${this.menuId}_${processedItem.key}_label`; + } + getItemClass(processedItem: any) { return { ...this.getItemProp(processedItem, 'class'),