diff --git a/src/app/components/menu/menu.ts b/src/app/components/menu/menu.ts index d6b14c02659..354e2b97f78 100755 --- a/src/app/components/menu/menu.ts +++ b/src/app/components/menu/menu.ts @@ -159,7 +159,7 @@ export class MenuItemContent { class="p-menu-list p-reset" role="menu" [attr.id]="id + '_list'" - [tabindex]="tabindex" + [attr.tabindex]="getTabIndexValue()" [attr.data-pc-section]="'menu'" [attr.aria-activedescendant]="activedescendant()" [attr.aria-label]="ariaLabel" @@ -432,6 +432,10 @@ export class Menu implements OnDestroy { }); } + getTabIndexValue(): string | null { + return this.tabindex !== undefined ? this.tabindex.toString() : null; + } + onOverlayAnimationStart(event: AnimationEvent) { switch (event.toState) { case 'visible':