[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 <elasticmachine@users.noreply.github.com>
This commit is contained in:
Nathan Reese 2025-01-20 14:01:13 -07:00 committed by GitHub
parent f4df5856f2
commit 583b852251
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.
*/