From c4ea4558cd4a33a576a1728e28fee170f563ab02 Mon Sep 17 00:00:00 2001 From: Melloware Date: Tue, 31 Dec 2024 07:40:54 -0500 Subject: [PATCH] Fix #7508: Disabled Menu item display (#7537) --- components/lib/menu/Menu.js | 2 +- components/lib/menu/MenuBase.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/menu/Menu.js b/components/lib/menu/Menu.js index cc5111e166..fb0d2373ee 100644 --- a/components/lib/menu/Menu.js +++ b/components/lib/menu/Menu.js @@ -357,7 +357,7 @@ export const Menu = React.memo( { onClick: (event) => onItemClick(event, item, key), onMouseMove: (event) => onItemMouseMove(event, key), - className: cx('content') + className: cx('content', { item }) }, getMenuItemPTOptions('content', menuContext) ); diff --git a/components/lib/menu/MenuBase.js b/components/lib/menu/MenuBase.js index 889d58612c..9ba56e75c0 100644 --- a/components/lib/menu/MenuBase.js +++ b/components/lib/menu/MenuBase.js @@ -40,7 +40,7 @@ const classes = { 'p-ripple-disabled': (context && context.ripple === false) || PrimeReact.ripple === false }), menu: 'p-menu-list p-reset', - content: 'p-menuitem-content', + content: ({ item }) => classNames('p-menuitem-content', { 'p-disabled': item.disabled }), action: ({ item }) => classNames('p-menuitem-link', { 'p-disabled': item.disabled }), menuitem: ({ focused }) => classNames('p-menuitem', { 'p-focus': focused }), submenuHeader: ({ submenu }) =>