From 8483574d1e6213d17a57e23bccf5927b160d51b2 Mon Sep 17 00:00:00 2001 From: Pete Harverson Date: Wed, 6 May 2020 09:26:58 +0100 Subject: [PATCH] [ML] Fixes reordering in view by selection when overall cell selected (#65290) --- .../ml/public/application/explorer/hooks/use_selected_cells.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/public/application/explorer/hooks/use_selected_cells.ts b/x-pack/plugins/ml/public/application/explorer/hooks/use_selected_cells.ts index 043b762334da9a..a19750494afdc1 100644 --- a/x-pack/plugins/ml/public/application/explorer/hooks/use_selected_cells.ts +++ b/x-pack/plugins/ml/public/application/explorer/hooks/use_selected_cells.ts @@ -33,12 +33,13 @@ export const useSelectedCells = (): [ const setSelectedCells = (swimlaneSelectedCells: AppStateSelectedCells) => { const mlExplorerSwimlane = { ...appState.mlExplorerSwimlane }; + if (swimlaneSelectedCells !== undefined) { swimlaneSelectedCells.showTopFieldValues = false; const currentSwimlaneType = selectedCells?.type; const currentShowTopFieldValues = selectedCells?.showTopFieldValues; - const newSwimlaneType = selectedCells?.type; + const newSwimlaneType = swimlaneSelectedCells?.type; if ( (currentSwimlaneType === SWIMLANE_TYPE.OVERALL &&