From 8f9bb245d49cdc7070b27602044219bf01d4a0ea Mon Sep 17 00:00:00 2001 From: melloware Date: Mon, 22 Jan 2024 14:02:36 -0500 Subject: [PATCH] Fix #5817: PanelMenu respect item.expanded prop --- 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) => {