Skip to content

Commit

Permalink
Fix #7692: Menu check all items for visible flag (#7696)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Feb 12, 2025
1 parent 7bf1050 commit 0939e21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/lib/menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ export const Menu = React.memo(
};

const createSeparator = (item, index) => {
if (item.visible === false) {
return null;
}

const key = idState + '_separator_' + index;
const separatorProps = mergeProps(
{
Expand All @@ -335,6 +339,10 @@ export const Menu = React.memo(
};

const createMenuItem = (item, index, parentId = null) => {
if (item.visible === false) {
return null;
}

const menuContext = { item, index, parentId };
const linkClassName = classNames('p-menuitem-link', { 'p-disabled': item.disabled });
const iconClassName = classNames('p-menuitem-icon', item.icon);
Expand Down

0 comments on commit 0939e21

Please sign in to comment.