fix: Show button focus styles only when needed#648
Merged
Conversation
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.
Short description
In our products today, when you click a button with the mouse, it stays visually as if hovered, even when you moved the mouse out of it. This is because buttons stay focused after clicked, and we have this rule that hover and focus states show visually the same. This is, of course, disruptive to mouse-centric users, who do not expect that unhovering leaves the button as if "engaged".
Here we're switching from
:focusto:focus-visible, which automatically and transparently fixes this issue. Browser support is already good enough (all latest versions of all major supported browsers already support this, and while we may still support older versions of these browsers that do not yet support this CSS pseudo-selector, this is acceptable as it is not super disruptive, and any user who complains only need to upgrade their browser of choice).PR Checklist
Added tests for bugs / new featuresUpdated docs (storybooks, readme)npm run validateand made sure no errors / warnings were shownCHANGELOG.mdBumped version inpackage.jsonandpackage-lock.json(npm --no-git-tag-version version <major|minor|patch>) refUpdated all static build artifacts (npm run build-all)Versioning
Patch release.