[Bug] Next and previous button stays in clicked state
Description
After clicking the Next button, its color changes from yellow to dark and stays that way. It only returns to the original yellow color after clicking somewhere else on the page, making it look inactive or disabled.
Expected Behavior
After the Next button is clicked, it should return to its normal yellow appearance immediately without requiring the user to click elsewhere on the page.
Screenshots
https://github.com/user-attachments/assets/eace8c17-4634-4721-a28b-c4787ba3f4d7
Environment:
- Host OS:
- Browser:
Contributor Resources and Handbook
The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.
- π See contributing instructions.
- π¨ Wireframes and designs for Layer5 site in Figma (open invite)
- ππΎππΌ Questions: Discussion Forum and Community Slack.
Join the Layer5 Community by submitting your community member form.
can I work on this issue?
I'd like to take this on and will open a small PR to fix the Next/Previous button staying in the clicked state.
Proposed fix: investigate and update the button implementation/styles (use real
Hi @Sbragul26 can I work on this?
Tracked this down. It isn't the pagination component, it's the shared reusecore/Button.
btn.style.js paints :hover and :focus with one declaration:
&:hover,
&:focus {
background: ${props => props.theme.activeColor}; // #3C494F
}
The $primary, $secondary and $outlined blocks below it each re-declare :hover, and not one of them re-declares :focus. Clicking with a mouse leaves the button focused, so the base :focus rule keeps winning and the button holds #3C494F. Clicking elsewhere blurs it, which is why the color comes back on its own.
Same reason Previous goes dark, around 0:11 in your video, right after it gets clicked.
Opened #7941. It scopes that base rule to :focus-visible, which a pointer click doesn't match, so the button returns to #EBC017 immediately. Tab still matches it, so the keyboard focus indicator stays where it was.
Worth knowing that this was never only about pagination. Every $primary, $secondary and $outlined button on the site sat in that dark state after a click.
Hi @leecalcote,
I would like to work on this issue as my first contribution to Layer5.
I have read the contributing guidelines and would like to fix the Next/Previous button clicked-state behavior described here.
My approach will be to keep the change focused on the button styling/interaction and verify the behavior locally.
Could you please assign this issue to me?
Thank you!
@vermarjun Just as a reminder for next time, we usually wait to be assigned to an issue before opening a PR.
@Sbragul26 , I want to work on this issue as my 1st contribution. May I be assigned this?
Hi, I'd like to work on this issue. Could you please assign it to me? @Sbragul26 .
@Sbragul26 can you please assign me this I want to work on this issue??
@Sbragul26 i have fix the issue can you plz review.