Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tabindex="-1" to content element #10

Open
simevidas opened this issue Mar 12, 2016 · 9 comments
Open

Add tabindex="-1" to content element #10

simevidas opened this issue Mar 12, 2016 · 9 comments

Comments

@simevidas
Copy link

Jeremy Keith has written about an accessible content toggle on his blog - https://adactio.com/journal/10365; it’s almost the same approach as a11y-toggle, except that he also adds tabindex="-1" to the content element, and then when the content is displayed, it is also focused programmatically. That sounds like a good idea.

@KittyGiraudel
Copy link
Collaborator

I'll ping @ffoodd for his opinion on the matter. :)

@adactio
Copy link

adactio commented Mar 13, 2016

I'm not sure whether automatically focusing the expanded content is a good idea or not. I'm hoping to get some feedback from screen reader users.

@KittyGiraudel
Copy link
Collaborator

Let’s ping @Heydon, he probably has an interesting opinion. :)

@Heydon
Copy link

Heydon commented Mar 13, 2016

I've moved focus automatically before, but I suspect it's quite jarring to screen reader users. So long as the expanded (true) state is announced, they know they have an expanded node they can move to - probably with the down arrow key or similar.

@KittyGiraudel
Copy link
Collaborator

What about tabindex="-1" on the collapsible area?

@ffoodd
Copy link

ffoodd commented Mar 14, 2016

Looking at @nico3333fr's jQuery plugin (which has been tested a lot) it doesn't use [tabindex] at all.

However accordingly to what @Heydon said, I think you may document the fact that collapsible region should be the next focusable area after the toggle button.

You'll have an exception when this is not the case (same condition than using [aria-controls], we talked about this earlier) and in this case moving the focus (or not) is another question, I guess. If collapsible region isn't the next focusable node, it could make sense to move the focus. I never tested that…

@Heydon
Copy link

Heydon commented Mar 14, 2016

Agree — moving focus probably the correct course if the element is not immediately after the toggle button. The main reason for this is low support for aria-controls which would otherwise offer the required shortcut to the expanded element.

@WW3
Copy link

WW3 commented Apr 3, 2016

Another option is using aria-owns which sets the referenced id as the next node in the a11y tree

@KittyGiraudel
Copy link
Collaborator

Discussed here: #3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants