From b3af1b4768d91ffd91522d2f78de8981480017b5 Mon Sep 17 00:00:00 2001 From: charithAmila Date: Mon, 11 Mar 2024 13:58:36 -0400 Subject: [PATCH] fix: #6054 --- components/lib/panelmenu/PanelMenuList.js | 7 +++++++ components/lib/panelmenu/PanelMenuSub.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) 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) => {