[PR #10651] fix(ui): use focus-visible instead of focus to prevent sticky hover effect on click #13513

Closed
opened 2026-02-16 18:18:21 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10651

State: closed
Merged: Yes


What does this PR do?

fixes the sticky hover effect bug where clicking on toggle/button components caused the hover background to persist until clicking elsewhere. The issue was caused by :focus styles being identical to :hover styles when an element receives focus on click, the focus styling stayed even after the mouse left. changed to :focus-visible which only applies for keyboard navigation, not mouse clicks.

it was staying like this forever:
image
image

How did you verify your code works?

  • clicked ghost buttons, select dropdowns, and session list items
  • moved mouse away and confirmed background returns to normal immediately
  • tested keyboard navigation (Tab) to confirm focus styling still appears for accessibility
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10651 **State:** closed **Merged:** Yes --- ### What does this PR do? fixes the sticky hover effect bug where clicking on toggle/button components caused the hover background to persist until clicking elsewhere. The issue was caused by :focus styles being identical to :hover styles when an element receives focus on click, the focus styling stayed even after the mouse left. changed to :focus-visible which only applies for keyboard navigation, not mouse clicks. it was staying like this forever: <img width="73" height="33" alt="image" src="https://github.com/user-attachments/assets/957229c4-5226-425e-b7bf-b55539960a00" /> <img width="82" height="54" alt="image" src="https://github.com/user-attachments/assets/6c1779ab-01f8-4d87-88bf-155a0ea235c4" /> ### How did you verify your code works? - [x] clicked ghost buttons, select dropdowns, and session list items - [x] moved mouse away and confirmed background returns to normal immediately - [x] tested keyboard navigation (Tab) to confirm focus styling still appears for accessibility
yindo added the pull-request label 2026-02-16 18:18:21 -05:00
yindo closed this issue 2026-02-16 18:18:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13513