forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not set full screen mode on ExitFullScreenButton re-render (elasti…
…c#198012) ### Background elastic#194892 is refactoring [DashboardRenderer](https://github.com/elastic/kibana/blob/3391344e8dc8377d359b918521b6c48838cde8ae/src/plugins/dashboard/public/dashboard_container/external_api/dashboard_renderer.tsx) component to replace Dashboard Embeddable with a plain old javascript object. Dashboard Embeddable rendered its contents in a new react tree. The new implementation does not. Since the new implementation does not render the dashboard in a new react tree, any re-render in `DashboardViewport` parent components causes `ExitFullScreenButton` to re-render. In its current form, re-rendering `ExitFullScreenButton` calls `onExit`, which causing dashboard to exit full screen mode. This PR makes use of `useCallback` to fix the issue where re-rending `ExitFullScreenButton` calls `onExit`. ### Test steps 1) Open dashboard that ships with sample web logs data set 2) switch to view mode 3) click "Full screen" button 4) Maximize a panel. Verify dashboard stays in full screen mode.
- Loading branch information
1 parent
1b92d5f
commit c69e5b8
Showing
2 changed files
with
19 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters