Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

🍕 Fix tab access in browser#174

Open
samccone wants to merge 1 commit intogooglearchive:masterfrom
samccone:sjs/fix-tab-index-issue
Open

🍕 Fix tab access in browser#174
samccone wants to merge 1 commit intogooglearchive:masterfrom
samccone:sjs/fix-tab-index-issue

Conversation

@samccone
Copy link
Contributor

sorta Fixes #104

@marcysutton
Copy link

This only goes part of the way there, and it could cause problems as-is. If possible, using tabindex="0" will keep the existing tab order in the page–that makes the collection of tabbable elements much easier to manage. Secondly, tabindex, on what's essentially a fancy div, isn't very useful by itself if there aren't a few key things:

  • A button role or native button element, assuming the behavior is button-like.
  • Text for a screen reader to know what the button is for. This can be a visually-hidden span or an aria-label, remembering localization requirements (the hardest part IMO).
  • A keydown or keypress event, since click won't fire from the keyboard on a custom element.

I like the way you're thinking though, keep it up! 🍕

@samccone
Copy link
Contributor Author

👍 thx for the protips :) will update

@marcysutton
Copy link

Here's a handy keyboard event reference, you can use it to determine which event to use for custom/non-semantic elements: http://unobfuscated.blogspot.com/2013/05/event-handlers-and-screen-readers.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants