Skip to content

Commit

Permalink
Fix #5817: PanelMenu respect item.expanded prop (#5823)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Jan 22, 2024
1 parent 746b32e commit b33953c
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 b33953c

Please sign in to comment.