Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Fixed EuiDataGrid height issue when in full-screen mode and with scrolling content ([#5557](https://github.com/elastic/eui/pull/5557))
- Fixed a focus bug in `EuiDataGrid` when clicking another cell header with an already-open cell header popover ([#5556](https://github.com/elastic/eui/pull/5556))
- Fixed `EuiDataGrid` to always focus back into the grid on pagination ([#5587](https://github.com/elastic/eui/pull/5587))
- Fixed `EuiDataGrid` and `EuiTable` pagination potentially rendering out view on narrow tables with many pages ([#5561](https://github.com/elastic/eui/pull/5561))

## [`46.1.0`](https://github.com/elastic/eui/tree/v46.1.0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,13 @@ exports[`EuiInMemoryTable behavior pagination 1`] = `
>
<EuiFlexGroup
alignItems="center"
className="eui-xScroll"
gutterSize="s"
justifyContent="spaceBetween"
responsive={false}
>
<div
className="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow"
className="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow eui-xScroll"
>
<EuiFlexItem
grow={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`EuiDataGrid pagination renders 1`] = `
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow"
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow eui-xScroll"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`EuiTablePagination is rendered 1`] = `
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow"
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow eui-xScroll"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
Expand Down Expand Up @@ -194,7 +194,7 @@ exports[`EuiTablePagination is rendered 1`] = `

exports[`EuiTablePagination is rendered when hiding the per page options 1`] = `
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow"
class="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--alignItemsCenter euiFlexGroup--justifyContentSpaceBetween euiFlexGroup--directionRow eui-xScroll"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
Expand Down
2 changes: 2 additions & 0 deletions src/components/table/table_pagination/table_pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ export class EuiTablePagination extends Component<
justifyContent="spaceBetween"
alignItems="center"
responsive={false}
gutterSize="s"
className="eui-xScroll"
Copy link
Contributor Author

@cee-chen cee-chen Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to note while this isn't the most "smart" solution, I think it's the one with the best tradeoffs.

The "smartest" pagination would be one that has a resize observer on itself and the underlying EuiPagination to make sure the width of one doesn't exceed the right bound of the other, but I strongly don't think the extra listeners and perf overhead are worth it vs. a simple overflow-x: auto;.

IMO, extremely small tables/grids are an edge case that we don't need to add a bunch of code for, and should mostly be caught by the responsive behavior of EuiPagination. Providing some way of accessing the overflowing UI via scrollbars should be sufficient until the day container queries become fully standard and we can just use those instead 🙏

>
<EuiFlexItem grow={false}>
{hidePerPageOptions ? null : itemsPerPagePopover}
Expand Down