Skip to content

Commit

Permalink
fix: close other panels when all pages panel opening (#279)
Browse files Browse the repository at this point in the history
Co-authored-by: Aleksey Danilov <[email protected]>
  • Loading branch information
jigetus and jigetus authored Jul 30, 2024
1 parent f64d3da commit 14a2f0f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const useAsideHeaderInnerContextValue = (
event: React.MouseEvent<HTMLDivElement, MouseEvent>,
) => {
if (item.id === ALL_PAGES_MENU_ITEM.id) {
onClosePanel?.();
setInnerVisiblePanel((prev) =>
prev === InnerPanels.AllPages ? undefined : InnerPanels.AllPages,
);
Expand All @@ -47,7 +48,7 @@ export const useAsideHeaderInnerContextValue = (
}
item.onItemClick?.(item, collapsed, event);
},
[innerOnClosePanel, ALL_PAGES_MENU_ITEM],
[innerOnClosePanel, ALL_PAGES_MENU_ITEM, onClosePanel],
);

const innerMenuItems = useMemo(
Expand Down

0 comments on commit 14a2f0f

Please sign in to comment.