WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Keyboard focus only

for

From: Mallory
Date: Feb 11, 2019 5:11AM


Sorry, my events are on the -down event, not -up.

On Mon, Feb 11, 2019, at 12:56 PM, Mallory wrote:
> I've been using 2 lines of JavaScript to hide huge/obvious focus rings
> from mouse users for some time now.
>
> Users can switch input modes whenever they want to.
>
> The issue with it is (besides if user testing showed sighted
> pointer-users feel lost without seeing a focus which belongs to the
> keyboard) is that it listens for `mouseup` and `keyup` events (styles
> default to keyboard meaning if no JS or no mouse events, keyboard focus
> styles show).
>
> It has occurred to me that there very well could be some setup where
> someone is acting like a sighted keyboard user and moving a
> keyboard-focus within the user agent but is not actually triggering
> "key-" events, though I don't know of one out of my head (I'm leaving
> touch alone, since they're weird and inconsistent in my testing, esp on
> desktop browsers on touchy-laptops/monitors). Even saying "press
> [somekey]" in Dragon triggers key events. What about switch control? I
> don't know, though I thought the various switch control programs out
> there overlayed their own focus styles...
>
> Lots of uncertainty but this has allowed me, as a bottom-rung front-end
> developer, to incorporate obvious visible focus styles for keyboard
> users when higher-rung designers and clients viewing demos complained
> about "people click the button and wonder why it looks funny/ugly."
>
> cheers,
> Mallory