WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Tabindex and initial focus

for

From: Birkir R. Gunnarsson
Date: Feb 2, 2018 8:17PM


I like the solution, but I'm not sure it addresses the initial question.
Setting a positive tabindex on an element by itself should not cause a
screen reader to autofocus on the element.
It only ensures that when the page loads and the user presses the tab
key, that the element with the lowest positive tabindex receives ocus.
MOst screen reader users do not use the tab key to inspect a page,
they are much more likely to explore using the arrow keys, navigate by
headings, landmarks or other semantic elements. Tabbing through the
webpage is not a good exploration technique for a screen reader user,
it is slow, cumbersome, and the user misses out on all the
non-focusable content.

So, if the focus is automatically placed on the first form field when
the page loads, there's got to be something else going on, either a
JavaScript focus() function or an autofocus attribute.



On 2/1/18, Swift, Daniel P. < <EMAIL REMOVED> > wrote:
> Good call, Jonathan:
>
> $(document).ready(function() {
> $('input').each(function(){
> if ($(this).attr('tabindex') > 0)
> $(this).attr('tabindex', 0);
> });
> });
>
>
> Dan Swift
> Senior Web Specialist
> Enterprise Services
> West Chester University
> 610.738.0589
>
>