Skip to content

Commit

Permalink
Fixed #14316
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Dec 27, 2023
1 parent f1fa5ec commit 0d2aac5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/components/megamenu/megamenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
selector: 'p-megaMenuSub',
template: `
<ul
*ngIf="isSubmenuVisible(submenu)"
#menubar
[ngClass]="{ 'p-megamenu-root-list': root, 'p-submenu-list p-megamenu-submenu': !root }"
[attr.role]="root ? 'menubar' : 'menu'"
Expand Down Expand Up @@ -312,6 +313,14 @@ export class MegaMenuSub {
};
}

isSubmenuVisible(submenu: any) {
if (this.submenu && !this.root) {
return this.isItemVisible(submenu);
} else {
return true;
}
}

isItemVisible(processedItem: any): boolean {
return this.getItemProp(processedItem, 'visible') !== false;
}
Expand Down

0 comments on commit 0d2aac5

Please sign in to comment.