Skip to content

fix(dockview-core): use :focus-visible for keyboard focus indicators#1373

Merged
mathuo merged 1 commit into
v8-branchfrom
fix/focus-visible-indicators
Jun 23, 2026
Merged

fix(dockview-core): use :focus-visible for keyboard focus indicators#1373
mathuo merged 1 commit into
v8-branchfrom
fix/focus-visible-indicators

Conversation

@mathuo

@mathuo mathuo commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Closes #1372.

Summary

Tab and paneview focus rings were keyed on :focus / :focus-within, so they appeared on mouse click too — visual noise often read as a defect. This switches the indicator rules to :focus-visible (keyboard-only).

  • defaultTab.scss.dv-tab:focus-visible, .dv-tab:has(:focus-visible) (the :has keeps the descendant case the old :focus-within covered — e.g. a keyboard-focused close button still rings its tab).
  • paneview.scss — pane header + body, same treatment.
  • Unchanged on purpose: the inline tab-rename <input> keeps :focus (inputs should always ring); the group content container keeps outline: none (it only ever takes programmatic focus).

:focus-visible and :has() are supported across all evergreen browsers. SCSS compiles clean (only the pre-existing @import deprecation remains).

Verification

Manual / visual (CSS-only; not unit-testable):

  • Tab/pane to a control → ring shows. Click with mouse → no ring.
  • Keyboard-focus a tab's close button → its tab still rings.
  • Rename input still rings on focus.

Context: one of the theme-dependent items from the accessibility conformance review (WCAG 2.4.7 / 1.4.11). Targets v8-branch for consistency with the active a11y work; cherry-pickable to master as a v7 patch.

🤖 Generated with Claude Code

The tab and paneview focus rings were keyed on `:focus` / `:focus-within`, so
they also showed on mouse click — visual noise that reads as a defect. Switch
the indicator rules to `:focus-visible` (keyboard-only), keeping the descendant
case via `:has(:focus-visible)` (e.g. a keyboard-focused close button still
rings its tab). The inline tab-rename input keeps `:focus` (inputs should always
ring) and the group content container keeps its `outline: none`.

WCAG 2.4.7 / 1.4.11. Closes #1372.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mathuo mathuo merged commit 3e51532 into v8-branch Jun 23, 2026
4 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant