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
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf
> Of Jonathan Avila
> Sent: Thursday, February 01, 2018 1:26 PM
> To: WebAIM Discussion List < <EMAIL REMOVED> >
> Subject: Re: [WebAIM] Tabindex and initial focus
>
>> While far from pretty, you could use JS to reset the focus. In the off
>> chance that you are using jQuery: $(this).removeAttr('tabindex');
>
> I would tighten that up to only remove positive indices as tabindex of 0 or
> -1 may be used for other good reasons. Furthermore, a safer approach might
> be to change all the positive tabindex values to 0s in case there were
> elements that needed to be added to the tab order.
>
> Jonathan
>
> Jonathan Avila
> Chief Accessibility Officer
> Level Access, inc. (formerly SSB BART Group, inc.)
> <EMAIL REMOVED>
> 703.637.8957 (Office)
> Visit us online: Website | Twitter | Facebook | LinkedIn | Blog Looking to
> boost your accessibility knowledge? Check out our free webinars!
>
> The information contained in this transmission may be attorney privileged
> and/or confidential information intended for the use of the individual or
> entity named above. If the reader of this message is not the intended
> recipient, you are hereby notified that any use, dissemination, distribution
> or copying of this communication is strictly prohibited.
>
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf
> Of Swift, Daniel P.
> Sent: Thursday, February 01, 2018 1:23 PM
> To: WebAIM Discussion List
> Subject: Re: [WebAIM] Tabindex and initial focus
>
> While far from pretty, you could use JS to reset the focus. In the off
> chance that you are using jQuery:
>
> $(document).ready(function() {
> $('input').each(function(){
> $(this).removeAttr('tabindex');
> });
> });
>
> Dan Swift
> Senior Web Specialist
> Enterprise Services
> West Chester University
> 610.738.0589
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf
> Of Joseph Sherman
> Sent: Thursday, February 01, 2018 1:08 PM
> To: 'WebAIM Discussion List' < <EMAIL REMOVED> >
> Subject: [WebAIM] Tabindex and initial focus
>
> Our PeopleSoft application uses positive tabindex on every interactive item
> in forms. No, we cannot change this. Yes, it's very annoying. Assuming focus
> is in the correct order, the problem is that initial focus for screen
> readers starts on the first tabindex on the page, skipping any directions or
> instructional material at the top of a page.
>
> Is this an inherent property of positive tabindexes, that they steal initial
> page focus, or is this something we can change?
>
>
> Joseph
> > > http://webaim.org/discussion/archives
> > > > http://webaim.org/discussion/archives
> > > > http://webaim.org/discussion/archives
> > > > > >


--
Work hard. Have fun. Make history.