Table: Fixes issue with pagination summary causing scrollbar (#65189)

* Table: Fixes pagination rows counter not causing scrollbar

* remove unused style
This commit is contained in:
Torkel Ödegaard
2023-03-22 18:57:05 +01:00
committed by GitHub
parent cd490ba0be
commit b2fb7a162a
2 changed files with 7 additions and 19 deletions

View File

@@ -326,15 +326,12 @@ export const Table = memo((props: Props) => {
}
paginationEl = (
<div className={tableStyles.paginationWrapper}>
{isSmall ? null : <div className={tableStyles.paginationItem} />}
<div className={tableStyles.paginationCenterItem}>
<Pagination
currentPage={state.pageIndex + 1}
numberOfPages={pageOptions.length}
showSmallVersion={isSmall}
onNavigate={onNavigate}
/>
</div>
<Pagination
currentPage={state.pageIndex + 1}
numberOfPages={pageOptions.length}
showSmallVersion={isSmall}
onNavigate={onNavigate}
/>
{isSmall ? null : (
<div className={tableStyles.paginationSummary}>
{itemsRangeStart} - {itemsRangeEnd} of {data.length} rows

View File

@@ -207,21 +207,12 @@ export function useTableStyles(theme: GrafanaTheme2, cellHeightOption: TableCell
margin-bottom: 0;
}
`,
paginationItem: css`
flex: 20%;
`,
paginationCenterItem: css`
flex: 100%;
display: flex;
justify-content: center;
`,
paginationSummary: css`
color: ${theme.colors.text.secondary};
font-size: ${theme.typography.bodySmall.fontSize};
display: flex;
justify-content: flex-end;
flex: 20%;
padding-right: ${theme.spacing(1)};
padding: ${theme.spacing(0, 1, 0, 2)};
`,
tableContentWrapper: (totalColumnsWidth: number) => {