Skip to content

Commit

Permalink
Fix table height (#16275)
Browse files Browse the repository at this point in the history
  • Loading branch information
geido authored Aug 17, 2021
1 parent d13b081 commit 9876c36
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions superset-frontend/src/components/TableView/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ const EmptyWrapper = styled.div`
`;

const TableViewStyles = styled.div<{
hasPagination?: boolean;
isPaginationSticky?: boolean;
scrollTable?: boolean;
small?: boolean;
}>`
${({ scrollTable, theme }) =>
${({ hasPagination, scrollTable, theme }) =>
scrollTable &&
`
height: 300px;
height: ${hasPagination ? '300px' : '380px'};
margin-bottom: ${theme.gridUnit * 4}px;
overflow: auto;
`}
Expand Down Expand Up @@ -191,10 +192,11 @@ const TableView = ({
}

const isEmpty = !loading && content.length === 0;
const hasPagination = pageCount > 1 && withPagination;

return (
<>
<TableViewStyles {...props}>
<TableViewStyles hasPagination={hasPagination} {...props}>
<TableCollection
getTableProps={getTableProps}
getTableBodyProps={getTableBodyProps}
Expand All @@ -217,7 +219,7 @@ const TableView = ({
</EmptyWrapperComponent>
)}
</TableViewStyles>
{pageCount > 1 && withPagination && (
{hasPagination && (
<PaginationStyles
className="pagination-container"
isPaginationSticky={props.isPaginationSticky}
Expand Down

0 comments on commit 9876c36

Please sign in to comment.