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 043b762334da9..a19750494afdc 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 &&