DEV Community

Discussion on: Focus Style for Keyboard Navigation Only

Collapse
 
westbrook profile image
Westbrook Johnson

I agree that :focus-visible is cool and all, but if an element is clicked and takes focus because of that, the UI should explain that to the user. Otherwise, how does low visibility but high dexterity user know what will happen when then subsequently use the enter or space keys to interact with the page?

They need to know what will happen visually. I can get the "let's not make it ugly" approach, but we could do that even without :focus-visible, we just need to put some common sense after out outline: none; declarations...

Even if there is long term benefit in distinguishing between focus applied by the keyboard and focus applied by the mouse, we can't simply stop showing the focus that comes with the mouse, it's still happening and cause side effects. In cases where :focus-visible is used, we should be backing it up with a :focus state that is acceptable in these contexts. Then we can both appease picky designers and support users who deserve high-quality experiences when using our applications.