From 4f6f0cb0c18fa1f7a895b0f393cd6aa9ae120762 Mon Sep 17 00:00:00 2001 From: Eugene Jahn Date: Sat, 9 Apr 2022 19:35:48 -0700 Subject: [PATCH] fix: on resize Header and body of the tables are mismatched Signed-off-by: Eugene Jahn --- src/components/Executions/Tables/styles.ts | 2 -- src/components/Tables/DataList.tsx | 4 +++- src/components/Tables/constants.ts | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Executions/Tables/styles.ts b/src/components/Executions/Tables/styles.ts index ca3938a38..723bea525 100644 --- a/src/components/Executions/Tables/styles.ts +++ b/src/components/Executions/Tables/styles.ts @@ -105,8 +105,6 @@ export const useExecutionTableStyles = makeStyles((theme: Theme) => ({ flexDirection: 'row', }, rowColumn: { - flexGrow: 0, - flexShrink: 0, marginRight: theme.spacing(1), minWidth: 0, paddingBottom: theme.spacing(1), diff --git a/src/components/Tables/DataList.tsx b/src/components/Tables/DataList.tsx index b266db89e..175f94d17 100644 --- a/src/components/Tables/DataList.tsx +++ b/src/components/Tables/DataList.tsx @@ -12,7 +12,7 @@ import { List, ListRowRenderer, } from 'react-virtualized'; -import { headerGridHeight, tableGridPadding } from './constants'; +import { headerGridHeight, tableGridPadding, minListContainerHeight } from './constants'; import { LoadMoreRowContent } from './LoadMoreRowContent'; const useStyles = makeStyles((theme: Theme) => ({ @@ -24,6 +24,8 @@ const useStyles = makeStyles((theme: Theme) => ({ listContainer: { display: 'flex', flexDirection: 'column', + // set minHeight to avoid AutoResizer setting height to 0 + minHeight: theme.spacing(minListContainerHeight), }, noRowsContent: { color: tablePlaceholderColor, diff --git a/src/components/Tables/constants.ts b/src/components/Tables/constants.ts index 061bd651d..d9df7d56c 100644 --- a/src/components/Tables/constants.ts +++ b/src/components/Tables/constants.ts @@ -1,3 +1,4 @@ export const loadMoreRowGridHeight = 6; export const headerGridHeight = 6; export const tableGridPadding = 1; +export const minListContainerHeight = 24;