Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use focus-visible for focus indicator heuristics #1332

Merged
merged 1 commit into from
Jan 13, 2021
Merged

Conversation

ianmcburnie
Copy link
Contributor

@ianmcburnie ianmcburnie commented Jan 12, 2021

Closes #1321

Uses :focus:not(:focus-visible) to surpress keyboard focus indicator according to browser's built in heuristics.

Browsers that do not support focus visible will remain unnaffected (i.e. no heauristics should be applied, and no removal of focus indicator should occur).

This PR also contains a change that updates the custom focus indicator for checkbox, radio and switch.


Example 1A: click the menu button with mouse. The menu button will open with no visible focus indicator.

Screen Shot 2021-01-12 at 3 30 25 PM

Example 1A: click the menu button with keyboard. The menu button will open with visible focus indicator on first menu item.

Screen Shot 2021-01-12 at 3 30 32 PM


Example 2A: click the open lightbox dialog button with mouse. The dialog will open with no visible focus indicator.

Screen Shot 2021-01-12 at 3 31 17 PM

Example 2A: click the open lightbox dialog button with keyboard. The dialog will open with visible focus indicator on close button.

Screen Shot 2021-01-12 at 3 31 24 PM

Copy link
Contributor

@austingardner austingardner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@agliga agliga merged commit 465b7ae into 12.0.0 Jan 13, 2021
@agliga agliga deleted the focus-visible branch January 13, 2021 19:04
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.

3 participants