Open
Conversation
Contributor
Author
|
@Philip-Cheung let's touch base in the new year, and confirm we're being consistent (in code and Figma, and from component to component.) |
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.
This PR makes changes to 5 components to handle focus states more consistently. Affected components are:
The key change is to the conditions for applying the offset focus ring, like this:
In these (mostly older) components, we previously used the RAC data attribute
[data-focused]to apply this style. This triggers whenever the element is in focus, whether via keyboard or via the user clicking into it, etc.This change updates these components to instead use the attribute
[data-focus-visible], which applies more narrowly only when the element is keyboard-focused. This is the approach we have adopted for most of our more recent components.TextField in non-keyboard focus (

[data-focused]):TextField in keyboard focus (

[data-focus-visible]):This change preserves the functionality of clearly indicating where focus is for users navigating via keyboard, but reduces visual load for other users (letting hover, border and cursor visual cues handle the task.)