Closed adxmantium closed 4 years ago
Deploy request for rebuild-black-business accepted.
Accepted with commit cad5b98c0b3abb818c793355a4ba36666371e0a5
https://app.netlify.com/sites/rebuild-black-business/deploys/5ee99d283e00e800074a6a5b
@all-contributors please add ajadams for code
@racedale
I've put up a pull request to add @ajadams! :tada:
Describe your PR
In #245 I fixed some pagination hover/focus styling issues, but there was some apparent tabbing issues (as noted by reviewers 🙏 ). Basically, it takes two tab presses in order to get to the next/prev pagination link - it should only take one, which is what this PR addresses.
As @magnificode mentions, this is caused by the Button component (
<button>
) being wrapped in an Link component (<a>
) and both of these elements are naturally tabbable elements, so the fix was to remove one of them - or better yet - combine them! 😮 Was able to maintain the Button styles, and turn it into a clickable link by setting itas={Link}
and removing the<Link>
component. I made this change for the pagination links and the pagination arrows as well.While I was in here, I fixed up two minor things as well related to pagination:
isDisabled
is a required prop inPaginationArrow
, but it didn't look like that prop was being used at all, so I removed it frompropTypes
so that it didn't continue to yell about it being required.getPageLink
func was returning a url with a?
even if there were no params (like when page=1) bcgetUpdatedSearchParams
returns an empty string when page=1. So I just added a condition to only return the url with?
if it has param.Related to Trello ticket # https://trello.com/c/NkrJyrQ2/206-pagination-focus-hits-two-elements
Pages/Interfaces that will change
Affects tabbing on Pagination links Before: it took two tab presses to nav to the next pagination link After: it will take one tab press to nav to next pagination link
Screenshots / video of changes
Steps to test
Additional Notes