Repository navigation
Hide the ring's focus ring after a pointer drag - #24
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Summary
Dragging the ring with a mouse drew the big keyboard focus ring around the thumb. The ring's
pointerdownhandler 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
given the ring at 200, when a pointer drags it, then the dial takes focus without showing the focus ringfails: the dial matches:focus-visible.After: the same test passes, along with the rest of
pnpm check(146 tests).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.