From 8253e98035c95cea1f036509f4aa961a6b32b3a8 Mon Sep 17 00:00:00 2001 From: Dzmitry Tamashevich Date: Wed, 23 Jun 2021 18:46:55 +0300 Subject: [PATCH] [Discover] set actual moveFocus flag --- .../apps/main/components/chart/discover_chart.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx index 052db28c3fd56..f1967d5b10b3e 100644 --- a/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx +++ b/src/plugins/discover/public/application/apps/main/components/chart/discover_chart.tsx @@ -59,8 +59,9 @@ export function DiscoverChart({ }, [state.hideChart]); const toggleHideChart = useCallback(() => { - stateContainer.setAppState({ hideChart: !state.hideChart }); - chartRef.current.moveFocus = true; + const newHideChart = !state.hideChart; + stateContainer.setAppState({ hideChart: newHideChart }); + chartRef.current.moveFocus = !newHideChart; }, [state, stateContainer]); const onChangeInterval = useCallback(