WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Keyboard focus only

for

From: Mallory
Date: Feb 11, 2019 4:56AM


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

On Wed, Feb 6, 2019, at 3:07 PM, David Feld wrote:
> Thanks, Jonathan. You're right, I didn't consider the scenario of
> switching back and forth. Good call.
>
> David
>
>
> From: "Jonathan Avila" < <EMAIL REMOVED> >
> To: "WebAIM Discussion List" < <EMAIL REMOVED> >
> Sent: Tuesday, February 5, 2019 8:17:56 PM
> Subject: Re: [WebAIM] Keyboard focus only
>
> > What are your general thoughts on applying focus only when keyboard use is detected?
>
> My concern is for users such as low vision users who switch back and
> forth between using the mouse and keyboard for navigation. There are
> cases where the user may use the keyboard and then the mouse and then
> may expect to take up where the keyboard was. Similar issue may happen
> for alternative input users as well who may switch between speech
> recognition and some other tool such as eye tracking. My preference
> would be to give the user control if keeping the keyboard focus is
> absolutely not possible. There was a discussion on github in the WICG
> https://github.com/WICG/focus-visible/issues/128
>
> Jonathan
>
> Jonathan Avila, CPWA
> Chief Accessibility Officer
> Level Access
> <EMAIL REMOVED>
> 703.637.8957 office
>
> Visit us online:
> Website | Twitter | Facebook | LinkedIn | Blog
>
> Looking to boost your accessibility knowledge? Check out our free webinars!
>
> The information contained in this transmission may be attorney
> privileged and/or confidential information intended for the use of the
> individual or entity named above. If the reader of this message is not
> the intended recipient, you are hereby notified that any use,
> dissemination, distribution or copying of this communication is
> strictly prohibited.
>
>