👩‍🏫 Quick thread on keyboard #a11y

If an interaction relies on a mouse-initiated action, it needs to be keyboard accessible too.

This means it may need to respond to Space and/or Enter as a trigger (hint: you get that for free with <button>).
If it opens something, it may need to close with Escape.

If it's scrollable, it needs to respond to Up/Down arrow keys.

If it's a group of related options (like autocomplete or tabs), it may need to respond to Up/Down or Left/Right arrow keys (search phrase: roving tabindex).
If it opens a dialog/modal, it needs to prevent tab access with elements outside of that experience (search phrases: "trapping focus" and "inert").

If it's interactive *at all* it needs to be able to gain keyboard focus, and that focus needs to have a visible style.
If a sighted mouse user can explore and make independent selections (like in an autocomplete), a keyboard user needs to be able to as well. This likely means allowing a combination of tab, arrow keys, and Enter to explore and then make a selection.
Any purely `:hover` triggered content should also allow `:focus` (ex. menus).

---

Yes, it's a lot to think about/remember - and none of it is optional.

Go test your projects and fix any interaction that isn't accessible by keyboard.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Stephanie Eckles

Stephanie Eckles Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @5t3ph

9 Mar
🟢 An Aside about HTML <aside>

When HTML5 was the new kid in town, multi-sidebar blogs were also very popular. And the <aside> element seemed like the right choice for sidebars - but is it?

Let's learn a bit more about <aside>!
In terms of assistive technology, an <aside> is announced with the implicit role of "complementary".

In terms of semantics, an <aside> cannot live within <main>.

For example - it's not going to be the right choice for ad content that lives within a <main>'s <article>.
By actual definition per MDN:

"The HTML <aside> element represents a portion of a document whose content is only indirectly related to the document's main content."

So what type of content can live there?
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!