diff --git a/public/app/core/components/AppChrome/AppChrome.tsx b/public/app/core/components/AppChrome/AppChrome.tsx index 548436f4101..6e2f3f9ad06 100644 --- a/public/app/core/components/AppChrome/AppChrome.tsx +++ b/public/app/core/components/AppChrome/AppChrome.tsx @@ -47,31 +47,32 @@ export function AppChrome({ children }: Props) { }); // Chromeless routes are without topNav, mega menu, search & command palette - if (state.chromeless) { - return ( -
-
{children}
-
- ); - } + // We check chromeless twice here instead of having a separate path so {children} + // doesn't get re-mounted when chromeless goes from true to false. return (
-
- {!searchBarHidden && } - -
+ {!state.chromeless && ( +
+ {!searchBarHidden && } + +
+ )}
{children}
- chrome.setMegaMenu(false)} /> - + {!state.chromeless && ( + <> + chrome.setMegaMenu(false)} /> + + + )}
); } diff --git a/public/app/core/components/AppChrome/AppChromeService.tsx b/public/app/core/components/AppChrome/AppChromeService.tsx index bc919918d99..641d4d87283 100644 --- a/public/app/core/components/AppChrome/AppChromeService.tsx +++ b/public/app/core/components/AppChrome/AppChromeService.tsx @@ -73,6 +73,7 @@ export class AppChromeService { // Some updates can have new instance of sectionNav or pageNav but with same values if (newState.sectionNav !== current.sectionNav || newState.pageNav !== current.pageNav) { if ( + newState.actions === current.actions && navItemsAreTheSame(newState.sectionNav, current.sectionNav) && navItemsAreTheSame(newState.pageNav, current.pageNav) ) {