diff --git a/components/lib/panelmenu/PanelMenuList.js b/components/lib/panelmenu/PanelMenuList.js index 107ac71f57..f9b38f91ae 100644 --- a/components/lib/panelmenu/PanelMenuList.js +++ b/components/lib/panelmenu/PanelMenuList.js @@ -201,6 +201,13 @@ export const PanelMenuList = React.memo((props) => { setActiveItemPath(_activeItemPath); } + if (processedItem.item) { + processedItem.item = { + ...processedItem.item, + expanded + }; + } + DomHandler.focus(getListElement()); setFocusedItem(processedItem); }; diff --git a/components/lib/panelmenu/PanelMenuSub.js b/components/lib/panelmenu/PanelMenuSub.js index b3d05002a1..b1bb734bef 100644 --- a/components/lib/panelmenu/PanelMenuSub.js +++ b/components/lib/panelmenu/PanelMenuSub.js @@ -44,7 +44,7 @@ export const PanelMenuSub = React.memo( }; const isItemActive = (processedItem) => { - return props.activeItemPath && props.activeItemPath.some((path) => path.key === processedItem.key); + return (props.activeItemPath && props.activeItemPath.some((path) => path.key === processedItem.key)) || !!processedItem.item?.expanded; }; const isItemVisible = (processedItem) => {