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

Focus order with TabIndex - is it allowed? #182

Closed
awkawk opened this issue Apr 25, 2016 · 6 comments
Closed

Focus order with TabIndex - is it allowed? #182

awkawk opened this issue Apr 25, 2016 · 6 comments
Assignees

Comments

@awkawk
Copy link
Member

awkawk commented Apr 25, 2016

Name: Zach sigal
Document: UW
Item Number: Understanding Success Criterion 2.4.3
Part of Item: Examples
Comment Type: question
Summary of Issue: focus order with tabindex - is it aloud?
Comment (Including rationale for any proposed change):
It is not clear (to me) from the examples if using TABINDEX in a form inputs is legal.
i.e the focus will start in the middle of the page (contact form fields), and then will move to the beginning (main menu).

@awkawk
Copy link
Member Author

awkawk commented Apr 25, 2016

Proposed response:
Zach, thanks for the question.

Authors may use the tabindex attribute to establish the focus order, but need to do so carefully so as to avoid inadvertantly creating a tab order that does not preserve the meaning and operation of the page.

Failure F44 (http://www.w3.org/TR/2016/NOTE-WCAG20-TECHS-20160317/F44) speaks to this issue but does not forbid the use of tab index; it specifies that the tab order needs to follow the relationships in the content.

If you have a suggestion for an example of the proper use of tabindex in a form we would be happy to review it for inclusion as an additional example in Understanding 2.4.3.

@awkawk awkawk self-assigned this Apr 25, 2016
@spanchang
Copy link

I see the situation referred to in that example not infreqquently.
The author's intention apparently is to help the user by placing focus directly into the form as one begins to tab on page load.
It works the first time only but quickly becomes problematic on using shift-tab or tab. Often some links and controls within the form too get excluded from tab order.
The better approach is to set focus on the first form control on page load perhaps and not use tabindex on selective elements.
Thanks,
Sailesh

@joshueoconnor
Copy link
Contributor

I think there is general dev confusion about what TAB order is for. Many just don't know that TAB order follows source order, for example. In a large number of cases use of bespoke tabindex patterns just isn't needed.

@patrickhlauke
Copy link
Member

i see many devs who assume tabindex is somehow limited to some local scope, e.g. that they're defining the order within the form, rather than for the entire document/page.

other situations would be pages that have a prominent primary form (like a big search box for a user to enter a reservation number or something) and authors are trying to be "helpful" by making this form / its components the first thing that receives focus

@patrickhlauke
Copy link
Member

possibly a side note not directly related to the original question, but: note that tabindex does not influence reading order when using reading keys on keyboard or standard swipe left/right gestures on mobile/AT. as such (and particularly in the mobile case, where swipe left/right is the primary means of navigating, as there's no direct TAB key) it's still likely that devs can easily get themselves into trouble when using tabindex

@awkawk
Copy link
Member Author

awkawk commented Jun 14, 2016

Responded to original commenter.

@awkawk awkawk closed this as completed Jun 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants