From 686479b7a3894c9e3c903ede776563dacc28e282 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 (cherry picked from commit 583b8522510102c15b175f4aff772484b689869f) --- .../dashboard_top_nav/internal_dashboard_top_nav.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx b/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx index 47a84b620ede3..5f24c616ca387 100644 --- a/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx +++ b/src/plugins/dashboard/public/dashboard_top_nav/internal_dashboard_top_nav.tsx @@ -121,6 +121,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. */