Skip to content

fix(Collapsible): show focus ring on keyboard focus of the trigger - #1312

Open
jay23606 wants to merge 2 commits into
ClickHouse:mainfrom
jay23606:pr-go/1306-bug-sidebarcollapsibleitem-shows-no-keyb
Open

jay23606 wants to merge 2 commits into
ClickHouse:mainfrom
jay23606:pr-go/1306-bug-sidebarcollapsibleitem-shows-no-keyb

Conversation

@jay23606

@jay23606 jay23606 commented Nov 16, 2026 •

Copy link
Copy Markdown

Bug

SidebarCollapsibleItem (and Collapsible.Trigger) gives no visible focus ring on keyboard focus. The trigger is an EmptyButton, which sets outline: none and has no :focus-visible style. The chevron is also hidden until hover, so keyboard users get no cue that focus is on the expand control.

Change

  • Collapsible.module.css: add a :focus-visible outline on .collapsible__trigger, and reveal the chevron while the trigger is focused.
  • Collapsible.test.tsx: add a render check that the trigger carries the module class the focus rule targets, and a check that the stylesheet declares the focus-visible outline.
  • Changeset (patch).

Testing

  • yarn vitest run src/components/Collapsible/Collapsible.test.tsx -t "shows a focus-visible outline": passes on this branch; fails on the base CSS with the expected assertion.
  • yarn vitest run src/components/Collapsible: 4/4 pass.
  • yarn typecheck and yarn eslint src/components/Collapsible/Collapsible.test.tsx: pass.

Not tested

  • The focus ring was not checked in a real browser or in Storybook. jsdom does not evaluate :focus-visible, so the outline is verified by reading the stylesheet, not by computed style.
  • Visual regression, Chromatic, and the a11y addon were not run.

Regression test: fails on base twice (//.{0,2}collapsible__trigger:focus-visible/), passes on fix twice (yarn vitest run src/components/Collapsible/Collapsible.test.tsx -t "shows a focus-visible outline")

Fixes #1306


Note

Low Risk
CSS-only accessibility styling and tests; no logic or data-path changes.

Overview
Fixes missing keyboard focus feedback on Collapsible.Trigger (including SidebarCollapsibleItem) by styling :focus-visible on .collapsible__trigger: a 2px outline using --click-global-color-outline-default, with inset outline-offset so the ring stays visible inside overflow-clipping sidebars.

While the trigger has keyboard focus, the expand chevron is now shown (same as on header hover), since it was otherwise hidden until hover.

Adds regression tests that the trigger gets collapsible__trigger and that the module CSS declares the focus ring rule; ships as a patch changeset for @clickhouse/click-ui.

Reviewed by Cursor Bugbot for commit 45e21ed. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit da3bbd6. Configure here.

@changeset-bot

changeset-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45e21ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SidebarCollapsibleItem shows no keyboard focus and hides its expand chevron until hover

1 participant