-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(pagination): use styled anchors instead of Button Pill #206
Conversation
|
Is the text supposed to be underlined when tabbing (focus/active?)? 🤔 😄 |
Fixed in warp-ds/css#163 and 4d9bc63 |
e65c3d9
to
29c78a6
Compare
'Next page' aria-label was missing from the Button with chevron because aria-label is not passed to <a> JSX element in Button component. Now that we've replaced Button with <a>, the aria-label is present and so we have multiple elements with 'button' role and 'Next page' label when Pagination is in first page view.
I guess that the page numbers also should have transparency when hovering? And they don't seem to have an active state? |
Good point with the transparency when hovering! I'll replace the
Based on previous feedback from designers, I think we don't need an active state on Page links when they are sort of selectable elements. A similar example would be the Tabs component. Wdyt? |
Feels a bit off to have the active state on the icons and not on the page links? 🤔 So either remove it for both or add it to pages as well? 🤷 🙂 I'm personally pro active state, though... I like to "slow click" things just to see that they seem to be working. 😄 😜 |
I can remove the active state from the icon links then. Seems like they did that in the search page, too. We can mention the active states topic to the designers but seeing other components like Tabs or Toggle, it looks like it was intentional to not have active state on "selectable" elements. |
I have just talked to Adi and he says that it does make sense to have active states here. I also discussed a few other topics, including accessibility, which I will summarize below:
|
## [1.4.1-next.4](v1.4.1-next.3...v1.4.1-next.4) (2024-02-15) ### Bug Fixes * **pagination:** use styled anchors instead of Button Pill ([#206](#206)) ([c0ae4e6](c0ae4e6))
## [1.4.1](v1.4.0...v1.4.1) (2024-02-15) ### Bug Fixes * bump deps ([#202](#202)) ([f5650c1](f5650c1)) * **pagination:** use styled anchors instead of Button Pill ([#206](#206)) ([c0ae4e6](c0ae4e6)) * Remove redundant component css class from modal backdrop ([#207](#207)) ([ef37ae0](ef37ae0)) * rename deleted icons after @warp-ds/icons update to 2.0.0 ([#205](#205)) ([121bd55](121bd55))
Blocked by warp-ds/css#166 wait for 1.8.2 stable release.
Description
Fixes WARP-501
After updating @warp-ds/css from 1.7.0 to 1.8.0 Pagination’s active button has inherited black text color from Button-pill styles (
s-icon
) instead of white (s-text-inverted
): https://warp-ds.github.io/react/?path=/story/navigation-pagination--normalAfter some discussion it was recommended that we should not use Button-pill component here because we want to avoid overriding classes and the use of !important rule, as well as Button-pill in its current form is a strong candidate for being deprecated from our component library. Therefore replacing it with a custom button/anchor seemed reasonable in order to fix the above-mentioned bug.
What's changed
Button
component of typepill
. It was replaced with an anchor, as that's what the Button component resolved to.aria-label
on NextButton's anchor is set correctly with "Next page". Previously that didn't get applied because Button component doesn't passprops['aria-label']
on to its anchor element (source).aria-label
on Page links now includes the actual page number, so when tabbing to each link "Page {number}" is announced.Note: in order to get rid of TS errors the
ref
attribute from the new elements was typed the same way as in Button component when it renders an anchor (source).