fix: focus outlines only on keyboard focus#2306
Conversation
File metricsOverall Δ: -1.82 KB ⬇ (-0.05%) card-< 1KB ⬇
dropzone-< 1KB ⬇
floatingactionbutton-< 1KB ⬇
tabs-< 1KB ⬇
textfield-< 1KB ⬇
|
0f2ee60 to
65321c2
Compare
65321c2 to
2328f5a
Compare
|
🚀 Deployed on https://pr-2306--spectrum-css.netlify.app |
2328f5a to
da25430
Compare
jawinn
left a comment
There was a problem hiding this comment.
The functionality is looking good to no longer show various focus indicators on click.
My biggest question is that we are adding the is-keyboardFocused class to some components that do not need that additional requirement. For example, on tabs, the issue is resolved by removing the :focus selector, as focus-visible already does not trigger on click with a div that has a tabindex. This applies to all the components here except for Textfield, which needs that class because :focus-visible is triggered differently when the field allows keyboard input.
Is the only benefit that we can have examples that show the keyboard focused state? We have been trying to clean up a lot of the unnecessary pseudos and state classes, so this seems to be going in the other direction. But may be desired if we want it for examples and Storybook.
da25430 to
0d66f23
Compare
Ah, yep. I went on a little "Chromatic Coverage!!!" rampage that didn't make sense in hindsight (we don't want coverage of |
0d66f23 to
a720a78
Compare
a720a78 to
ab912eb
Compare
jenndiaz
left a comment
There was a problem hiding this comment.
Checked each component and compared against main, I saw no issues!
|
@jnjosh would you mind taking a peek at this one, too? |
ab912eb to
1f72c3e
Compare
Description
Some of our components (breadcrumb, card, dropzone, floatingactionbutton, tabs, textfield) were showing and persisting a keyboard focus indicator on mouse focus. This PR adjusts those components to show the correct focus indicators for keyboard and mouse.
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Breadcrumb component
In Storybook:
Card component
In Storybook:
Docs site includes:
Dropzone component
In Storybook:
Floatingactionbutton component
In Storybook:
Tabs component
In Storybook:
Textfield component
In Storybook:
Docs site includes:
Regression testing
Validate:
Screenshots
To-do list