Repository navigation
Combobox: the focus ring is a has rule, the rules' first real use (#443) - #460
Merged
Merged
Conversation
…443) The combobox's box, shadcn's input group, wore its ring through its own `focus_within` variant. It is now `has(Match::focus_visible(), ..)`: the box's border color and ring while a child, the field, has focus, as shadcn's `has-[[data-slot=input-group-control]:focus-visible]` does. The rule reads last frame's focus, so the ring follows the focus a frame later. Behavior changes: none in the goldens; the ring appears a frame after the field takes focus instead of in the frame it does. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
Owner
Author
|
Approved by the user on its tests (2026-11-20); the one-frame ring lag accepted. GitHub's required checks pass on the branch merged with current main. Merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #443: the rules' first real use, as a proof. Goldens unchanged.
The combobox's box (shadcn's input group) wore its focus ring through its own
focus_withinvariant. It is nowhas(Match::focus_visible(), |b| b.border_color(..).ring(..)), the form of shadcn'shas-[[data-slot=input-group-control]:focus-visible]:ring. The rule reads last frame's focus, so the ring appears a frame after the field takes focus, where the variant drew it in the same frame; nothing else changes.Test:
the_combobox_box_wears_the_focus_ring_while_its_field_has_focus(no ring painted before focus, a ring painted after, through the real draw path). The command-palette, combobox and snapshot tests pass (26) with every golden as it was; clippy and fmt pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy