Skip to content

Hide the ring's focus ring after a pointer drag - #24

Merged
ericchernuka merged 1 commit into
masterfrom
ec/reduce-pointer-focus-ring
Nov 14, 2026
Merged

ericchernuka merged 1 commit into
masterfrom
ec/reduce-pointer-focus-ring

Conversation

@ericchernuka

Copy link
Copy Markdown
Owner

Summary

Dragging the ring with a mouse drew the big keyboard focus ring around the thumb. The ring's pointerdown handler focused the SVG itself, before Chrome had registered the press as a mouse interaction, so the dial matched :focus-visible. A click already moves focus to the dial, so the call is gone.

 Ring onPointerDown
   setPointerCapture
-  focus()            # read as keyboard focus → ring shows
   send(aim)

Tabbing to the dial or pressing an arrow key after a drag still shows the ring. The phone wheel never had the problem.

Evidence

  • Before: given the ring at 200, when a pointer drags it, then the dial takes focus without showing the focus ring fails: the dial matches :focus-visible.
    After: the same test passes, along with the rest of pnpm check (146 tests).
real mouse down + up on the ring
expect dial toHaveFocus
expect dial matches(':focus-visible') == false

I also checked it by hand in Chrome. After a drag the dial has focus with no ring, and pressing ArrowRight brings the ring back and moves the hue from 200 to 205.

Merge Danger

Door: two-way

Blast Radius: tiny

Only the roomy layout's ring is affected. Pointer focus now comes from the browser's own mousedown instead of the script.

The ring's pointerdown handler focused the SVG itself. That ran before
Chrome saw the press as a mouse interaction, so the dial matched
:focus-visible and drew the large keyboard focus ring. A click already
moves focus to the dial, so the call goes. Keyboard focus still shows
the ring.
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
huebo Ready Ready Preview Nov 14, 2026 3:16pm UTC

@ericchernuka
ericchernuka merged commit 1329ae5 into master Nov 14, 2026
3 checks passed
@ericchernuka
ericchernuka deleted the ec/reduce-pointer-focus-ring branch November 14, 2026 15:19

This branch was successfully deployed

1 active deployment
Preview — 63183bbb Deployed Nov 14, 2026 by vercel[bot]
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