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; } }