Skip to content

Commit

Permalink
Update PanelMenu.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrogenous committed Nov 8, 2023
1 parent c3ef28f commit 7c9936e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/lib/panelmenu/PanelMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const PanelMenu = React.memo(
};

const onItemClick = (event, item) => {
if (item.disabled || !item.items) {
if (item.disabled) {
event.preventDefault();

return;
Expand Down Expand Up @@ -82,8 +82,10 @@ export const PanelMenu = React.memo(
activeItem.expanded = false;
}

item.expanded = true;
setActiveItemState(props.multiple ? [...(activeItem || []), item] : item);
if (item.items) {
item.expanded = true;
setActiveItemState(props.multiple ? [...(activeItem || []), item] : item);
}
}
};

Expand Down

0 comments on commit 7c9936e

Please sign in to comment.