Skip to content

Commit

Permalink
Fix #5868: TieredMenu respect menuitem className (#5869)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Feb 1, 2024
1 parent db4990c commit 1f613e3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/lib/tieredmenu/TieredMenuBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion components/lib/tieredmenu/TieredMenuSub.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 1f613e3

Please sign in to comment.