Skip to content

Commit

Permalink
Fix primefaces#5817: PanelMenu respect item.expanded prop
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jan 22, 2024
1 parent 746b32e commit 8f9bb24
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/lib/panelmenu/PanelMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ export const PanelMenu = React.memo(
};

const isItemActive = (item) => {
return props.expandedKeys ? props.expandedKeys[getItemProp(item, 'key')] : props.multiple ? activeItemsState.some((subItem) => ObjectUtils.equals(item, subItem)) : ObjectUtils.equals(item, activeItemState);
if (props.expandedKeys) {
return props.expandedKeys[getItemProp(item, 'key')];
} else {
const result = props.multiple ? activeItemsState.some((subItem) => ObjectUtils.equals(item, subItem)) : ObjectUtils.equals(item, activeItemState);

return result || item.expanded;
}
};

const isItemVisible = (item) => {
Expand Down

0 comments on commit 8f9bb24

Please sign in to comment.