From a10dcf966144e81ee11f701dee36f72ac5b9c9c4 Mon Sep 17 00:00:00 2001 From: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:47:05 +0200 Subject: [PATCH] Explore (bugfix): Expanded section state (#86594) Fix --- .../app/features/explore/ContentOutline/ContentOutline.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/explore/ContentOutline/ContentOutline.tsx b/public/app/features/explore/ContentOutline/ContentOutline.tsx index d11b6b7de15..0c4be514453 100644 --- a/public/app/features/explore/ContentOutline/ContentOutline.tsx +++ b/public/app/features/explore/ContentOutline/ContentOutline.tsx @@ -86,7 +86,7 @@ export function ContentOutline({ scroller, panelId }: { scroller: HTMLElement | return childTop && childTop >= offsetTop; }); - if (activeChild) { + if (activeChild && isCollapsible(item)) { setActiveSectionChildId(activeChild.id); setActiveSectionId(item.id); break; @@ -95,6 +95,10 @@ export function ContentOutline({ scroller, panelId }: { scroller: HTMLElement | if (activeItem) { setActiveSectionId(activeItem.id); setActiveSectionChildId(undefined); + setSectionsExpanded((prev) => ({ + ...prev, + [item.id]: false, + })); break; } }