diff --git a/components/lib/tieredmenu/TieredMenuBase.js b/components/lib/tieredmenu/TieredMenuBase.js index 172d14fffb..0084886dbd 100644 --- a/components/lib/tieredmenu/TieredMenuBase.js +++ b/components/lib/tieredmenu/TieredMenuBase.js @@ -19,7 +19,7 @@ const classes = { label: 'p-menuitem-text', submenuIcon: 'p-submenu-icon', action: 'p-menuitem-link', - menuitem: ({ _className, active, focused, disabled }) => classNames('p-menuitem', { 'p-menuitem-active p-highlight': active, 'p-focus': focused, 'p-disabled': disabled }, _className), + menuitem: ({ itemClassName, active, focused, disabled }) => classNames('p-menuitem', { 'p-menuitem-active p-highlight': active, 'p-focus': focused, 'p-disabled': disabled }, itemClassName), menu: 'p-tieredmenu-root-list', submenu: 'p-submenu-list', transition: 'p-connected-overlay' diff --git a/components/lib/tieredmenu/TieredMenuSub.js b/components/lib/tieredmenu/TieredMenuSub.js index 36f7c33f9d..a7345669d4 100644 --- a/components/lib/tieredmenu/TieredMenuSub.js +++ b/components/lib/tieredmenu/TieredMenuSub.js @@ -163,6 +163,7 @@ export const TieredMenuSub = React.memo( const item = processedItem.item; const style = getItemProp(processedItem, 'style'); + const itemClassName = getItemProp(processedItem, 'className'); const _icon = getItemProp(processedItem, 'icon'); const target = getItemProp(processedItem, 'target'); const url = getItemProp(processedItem, 'url'); @@ -255,7 +256,7 @@ export const TieredMenuSub = React.memo( 'data-p-highlight': active, 'data-p-disabled': disabled, 'data-p-visited': focused, - className: cx('menuitem', { className: item.className, active, focused, disabled }), + className: cx('menuitem', { itemClassName, active, focused, disabled }), style: style, onMouseEnter: (event) => onItemMouseEnter(event, item), role: 'menuitem'