-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EuiTablePagination] Adding a Show all
option; Plus Pagination Guidelines
#5547
Conversation
…rows’` option for `compressed`
…pdating the other `arrow` icons to a thicker weight
…nation # Conflicts: # CHANGELOG.md # src/components/icon/__snapshots__/icon.test.tsx.snap
[Breaking] Changed `hidePerPageOptions` to the positive `showPerPageOptions`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is now ready for review while I finish up the PR checklist. 😄
<EuiFlexGroup | ||
justifyContent="spaceBetween" | ||
alignItems="center" | ||
responsive={false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed responsive={false}
to better ensure that the items wrap on small screens. Still not 100% effective for responsive behavior, but better than getting cutoff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think I've solved this even better:
Before the layout added scrollbars, but the problem is that this visually prioritizes the "Rows per page" instead of the actual pagination numbers.
After the layout has wrap
on it, so without having to monitor the actual size of the container, if it's too narrow the pagination numbers will just wrap below the "Rows per page" first, then scroll if still necessary
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
Fix dark mode in guidelines
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the lateness, I planned on finishing reviewing last Friday after my eye exam but then my pupils got dilated and my near vision was shot for a few hours after 🙈 I just have some some super minor type-related feedback, everything else looks great!
This PR is ready for final review. Thanks so much @constancecchen for addition of the @1Copenut I'd love you a11y evaluation over how this affects the overall table screen reader functionality. You can see a full example under the |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
@cchaos I took a look at the linked page, and spent a while considering language. I noticed the option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the wrap change! This LGTM to me from a code POV, although I have a few small perf suggestions. If you're OK with them I can push up the memoization hooks to this branch, up to you
Yes please!!! 🙏 |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
@1Copenut Based on Gail's recommendation for the button text and your suggestion for screen-reader text, I've just gone ahead and updated the option's visible text to include the word |
Preview documentation changes for this PR: https://eui.elastic.co/pr_5547/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the issues.
I read the guidelines and tested the changes again. LGTM! 🎉
Guidelines
Can be found at
/navigation/pagination/guidelines
.Internal only: Google doc for reference
EuiTablePagination
🔔 Breaking Change
This is a semi-trivial change, but I changed the name of the prop
hidePerPageOptions
toshowPerPageOptions
because I hate double-negative prop names. Boolean props should always be in the positive (with the exception ofdisabled
since we inherit this from standard HTML). So that it's easier to readshowPerPageOptions={false}
vshidePerPageOptions={true}
.Added the ability to present a "Show all" option by passing
'all'
in theitemsPerPage
arrayIfBut the idea is to not have to add yet another boolean prop but make it available as an option in the array.0
doesn't seem appropriate, I'm up for suggestions (maybe-1
is better).Unless someone can help@constancecchen helped me allow the termall
into that prop's array as a different way to do this.When this option is selected, it will hide the numbered pagination and present the button text as "Showing all".
Added a docs example for this component under Pagination / Table Pagination
With props tab and playground.
Other small fixes
Fixed layout of EuiTablePagination when it's container is narrow
Before the layout added scrollbars, but the problem is that this visually prioritizes the "Rows per page" instead of the actual pagination numbers.
After the layout has
wrap
on it, so without having to monitor the actual size of the container, if it's too narrow the pagination numbers will just wrap below the "Rows per page" first, then scroll if still necessaryFixed EuiImage images from staying restricted to it's parent container's width, by adding
max-width: 100%
:Before

After

Checklist