layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

[Bug] Next and previous button stays in clicked state

Open Sbragul26 opened this issue 3 months ago β€’ 10 comments

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.

Join the Layer5 Community by submitting your community member form.

Sbragul26 avatar Aug 08 '26 07:08 Sbragul26

can I work on this issue?

ayanasarkar avatar Aug 08 '26 07:08 ayanasarkar

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?

RaIyAn90 avatar Aug 08 '26 08:08 RaIyAn90

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.

vermarjun avatar Aug 08 '26 10:08 vermarjun

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!

mohammedyehaya2003 avatar Aug 08 '26 16:08 mohammedyehaya2003

@vermarjun Just as a reminder for next time, we usually wait to be assigned to an issue before opening a PR.

Maanvi212006 avatar Aug 09 '26 02:08 Maanvi212006

@Sbragul26 , I want to work on this issue as my 1st contribution. May I be assigned this?

Abh-igyan avatar Aug 10 '26 03:08 Abh-igyan

Hi, I'd like to work on this issue. Could you please assign it to me? @Sbragul26 .

arshika-afza3 avatar Aug 10 '26 15:08 arshika-afza3

@Sbragul26 can you please assign me this I want to work on this issue??

DS123-ally avatar Aug 14 '26 14:08 DS123-ally

@Sbragul26 i have fix the issue can you plz review.

DS123-ally avatar Aug 16 '26 13:08 DS123-ally