Skip to content

A selected Dropdown option lacks a token-based focus treatment in normal colors #240

Description

@woksin

What happens

In @cratis/components 4.1.0, keyboard focus on a selected Dropdown option is rendered with Chromium's default saturated-blue rectangular outline. The package styles focused and selected option backgrounds/text in normal colors, but defines a deliberate option outline only in forced colors, so the normal-color stable option state never consumes the public Cratis focus token.

This is not an absent-focus claim: the browser default remains visible. The defect is that the package-owned option state leaks a user-agent style instead of providing a token-based normal-color treatment.

Evidence

The evidence is bound to exact tag v4.1.0 (c4c4cc9a13c6416eb3ab31701546e961b4e9da72):

  • DropdownImplementation.tsx renders the stable .cratis-dropdown__option / data-cratis-part='option' with selected state.
  • Dropdown.css gives normal-color focused and selected options background/text styling only. The only explicit option outline is 2px solid Highlight inside @media (forced-colors: active).
  • The consumer already maps --cratis-focus-ring, selected background, and selected text tokens. A current keyboard-focused selected option still shows the browser's bright-blue outline.

What it costs a consumer

The current result falls outside the consumer's token-driven focus language on every Dropdown surface. A local selector against .cratis-dropdown__option[data-focused] would duplicate package state ownership and couple the consumer to package DOM/CSS. The cost is visual and accessibility consistency rather than lost functionality, but it leaves the advertised focus-token contract incomplete for this stable part.

Suggested fix — the seam

Define a deliberate normal-color keyboard-focus treatment for the stable Dropdown option state that consumes the public Cratis focus token. Keep focused and selected states distinguishable in light and dark themes and preserve the existing forced-colors Highlight treatment. Add package-owned normal-color and forced-colors coverage.

What is explicitly not being asked for

  • No global suppression of focus indication and no removal of the forced-colors outline.
  • No prescribed outline width, offset, radius, or other CSS bytes beyond consuming the public token contract.
  • No consumer selector against package or React Aria internals.
  • No redesign of Dropdown selection colors or the consumer theme.

Related, not duplicate

#211 is broad cross-browser and assistive-technology certification work. It is related, but it does not describe or settle this atomic normal-color selected-option focus-style defect.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions