From b33953ce2cb795aef11e39416a019d1476cd0cd9 Mon Sep 17 00:00:00 2001 From: Melloware Date: Mon, 22 Jan 2024 14:11:57 -0500 Subject: [PATCH] Fix #5817: PanelMenu respect item.expanded prop (#5823) --- components/lib/panelmenu/PanelMenu.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/lib/panelmenu/PanelMenu.js b/components/lib/panelmenu/PanelMenu.js index 8d356eb9f2..0009478a07 100644 --- a/components/lib/panelmenu/PanelMenu.js +++ b/components/lib/panelmenu/PanelMenu.js @@ -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) => {