-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: add pagination nav component #6199
feat: add pagination nav component #6199
Conversation
Deploy preview for carbon-elements ready! Built with commit 0b80936 |
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit 0b80936 https://deploy-preview-6199--carbon-components-react.netlify.app |
I've had this completed for almost 9 months now, including the overflow behavior but since it was deprioritized, all I have left is the test suite. if we're ready to bring this into the library I can just round out the test suite and open a PR |
@aagonzales gave it a look and really liked the changes! I think we could bring in the UX changes along with the code formatting stuff mentioned above (along with style guide stuff). Feel free to use any of the existing work too and we can definitely help ya out 😄 If you have any questions about tests btw, just let me know! |
@joshblack Thanks for the feedback (and the addition of translateWithId in the styleguide). I refactored the component accordingly. Would you mind taking another look and if there are only minor things left, I can work on the test suite. |
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.
Looking great! 🎉 Just had a couple of questions:
- What should the responsive behavior be like for this component?
- Do we need to flag the current page with
aria-current="page"
?
For determining cuts, it seems like it works great at the midpoint but when hitting past that it seems to make what is clicked jump to the edge before the overflow:
Would it make sense to have that midpoint behavior happen throughout the range of pages?
<select | ||
className={`${prefix}--pagination-nav__page ${prefix}--pagination-nav__page--select`} | ||
aria-label={`Select ${t('carbon.pagination-nav.item')} number`} | ||
onChange={e => { |
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.
Should we be using onBlur
here per the jsx-a11y
rule?
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.
|
Hey @janhassel! 👋 So glad that this got moved from draft -> ready for review 🎉 I wanted to ask you if you had an open slot sometime this week for us to go over the PR on a call? Thought it might be helpful for all of us and hopefully speed up the process of getting things merged in 😄 This really would only be talking through the component, its intended behaviors, any relevant implementation details you think are worth sharing, etc. Totally understand if not! Just wanted to reach out and see. |
@joshblack Definitely! I sent you an invite for tomorrow morning, feel free to counter if you prefer a different time slot 🙂 |
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 is awesome work. So far it looks good
Good to go:
MacOS: Chrome, Firefox, and Safari. No DAP violations. Keyboard navigation works.
Issues on VO:
Safari:
When selecting a page it doesn't announce if I have selected it. If I am navigating via arrows it does not read which page I am highlighting.
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.
Found a few things testing with JAWS 2020 and NVDA on Firefox latest in Windows 10:
- the active button has no focus state
- the current active page button is described as "unavailable" -- which makes sense technically, but sounds quite confusing
- when the user selects a page the button's label should be updated to 'active'
- the next page button when activated doesn't announce the changes (updated page from previous page)
Thanks for the feedback!
I'm currently facing the problem that the live region "Page 5 of 10" is read twice and after some poking around it seems that the component is rendering twice when a button is clicked. However, I cannot see this in the React DevTools Profiler. |
Hi @janhassel ! I talked to Jeannie about the selected+focus state overlap and she says its fine. We agree it does look not the best but we can live with it since its a temporary state and follows the correct styles. |
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 the updates! LGTM pending @dakahn changes
We're reading button updates now with NVDA which is great. When the 'next page button' is activated you just here '5', '6' ,'7' etc maybe something more clear might be, "page 5, active", but this isn't a blocker. Unavailable is what's read by JAWS and NVDA in place of dimmed -- it's not a blocker technically since it's correct.
|
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.
We're actually good to go here. JAWS is reading aria-live updates just fine. (fun fact, JAWS will not read aria-live
updates unless it is started and running before opening Firefox -- I'm talking to you, future me)
@dakahn That's good to know actually, might save me a lot of time debugging once I have access to the JAWS machine again 😀 I added |
React implementation of PaginationNav component. https://the-carbon-components.netlify.app/?nav=pagination-nav
@joshblack We talked about this one a while ago, especially the dynamic behaviour of the overflow. I opened this as a draft PR so we can get a discussion started on what you guys need from us for this contribution.
This PR comes with two UX teaks in comparison to the current vanilla component.