WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Keyboard focus only


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."


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
> 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.
> -----Original Message-----
> From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of
> David Feld
> Sent: Tuesday, February 5, 2019 5:18 PM
> To: WebAIM Discussion List < <EMAIL REMOVED> >
> Subject: [WebAIM] Keyboard focus only
> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you recognize the sender and
> know the content is safe.
> Forgive me if this has already been discussed -- I scanned the archives
> and didn't see it: What are your general thoughts on applying focus
> only when keyboard use is detected? Paul Adam (who I've seen on this
> list) made a demo:
> [ http://pauljadam.com/demos/keyboard-focus-only.html |
> http://pauljadam.com/demos/keyboard-focus-only.html ]
> In other words, mouse users would never see the focus. At first blush,
> this seems like a good way to make both keyboard users and web
> designers happy. Am I missing something?
> David
> David Feld
> Technical Director, Interactive Services Savannah College of Art and Design®
> [ mailto: <EMAIL REMOVED> | <EMAIL REMOVED> ] - [ http://www.scad.edu/ |
> www.scad.edu ] > > archives at http://webaim.org/discussion/archives
> > > > > > > > > >