From de5be06bc44849dfebef7e13ea2c6f6925d2153b Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 20 Jan 2025 14:01:13 -0700 Subject: [PATCH] [dashboard] fix Chrome no longer hidden for reports (#206988) Fixes https://github.com/elastic/kibana/issues/205794 https://github.com/elastic/kibana/pull/196275 removed `setIsVisible` because https://github.com/elastic/kibana/pull/196275/files#r1811034594. I could not reproduce the top nav disappearing and reappearing issue. --------- Co-authored-by: Elastic Machine --- .../dashboard_top_nav/internal_dashboard_top_nav.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx b/src/platform/plugins/shared/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx index 71f28d94fe2d3..7cb39231e814a 100644 --- a/src/platform/plugins/shared/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx +++ b/src/platform/plugins/shared/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx @@ -118,6 +118,13 @@ export function InternalDashboardTopNav({ dashboardTitleRef.current?.focus(); }, [title, viewMode]); + /* + * Manage chrome visibility when dashboard is in print mode. + */ + useEffect(() => { + if (!embedSettings && viewMode === 'print') coreServices.chrome.setIsVisible(false); + }, [embedSettings, viewMode]); + /** * populate recently accessed, and set is chrome visible. */