From 966373c968a1cc268856e69284cef89b64eb41fb Mon Sep 17 00:00:00 2001 From: Uladzislau Lasitsa Date: Fri, 22 Oct 2021 11:35:01 +0300 Subject: [PATCH] Remove temp fix --- .../public/components/table_vis_basic.tsx | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/plugins/vis_types/table/public/components/table_vis_basic.tsx b/src/plugins/vis_types/table/public/components/table_vis_basic.tsx index cfe1ce5d40a1e..2476c17c58a4d 100644 --- a/src/plugins/vis_types/table/public/components/table_vis_basic.tsx +++ b/src/plugins/vis_types/table/public/components/table_vis_basic.tsx @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import React, { memo, useCallback, useMemo, useEffect, useState, useRef } from 'react'; +import React, { memo, useCallback, useMemo } from 'react'; import { EuiDataGrid, EuiDataGridProps, EuiDataGridSorting, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { orderBy } from 'lodash'; @@ -111,26 +111,6 @@ export const TableVisBasic = memo( [columns, setColumnsWidth] ); - const firstRender = useRef(true); - const [dataGridUpdateCounter, setDataGridUpdateCounter] = useState(0); - - // key was added as temporary solution to force re-render if we change autoFitRowToContent or we get new data - // cause we have problem with correct updating height cache in EUI datagrid when we use auto-height - // will be removed as soon as fix problem on EUI side - useEffect(() => { - // skip first render - if (firstRender.current) { - firstRender.current = false; - return; - } - // skip if auto height was turned off - if (!visConfig.autoFitRowToContent) { - return; - } - // update counter to remount grid from scratch - setDataGridUpdateCounter((counter) => counter + 1); - }, [visConfig.autoFitRowToContent, table, sort, pagination, columnsWidth]); - return ( <> {title && ( @@ -139,7 +119,6 @@ export const TableVisBasic = memo( )}