WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Tabindex and initial focus

for

Number of posts in this thread: 10 (In chronological order)

From: Joseph Sherman
Date: Thu, Feb 01 2018 11:07AM
Subject: Tabindex and initial focus
No previous message | Next message →

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

From: Steve Green
Date: Thu, Feb 01 2018 11:16AM
Subject: Re: Tabindex and initial focus
← Previous message | Next message →

Good grief, do they think it's 1999? Unless you're able to add some JavaScript to remove all those tabindexes or add tabindex="1" to an element at the top of the page, I don't think there's much you can do. Perhaps someone can write a browser extension that does that.

Steve Green
Managing Director
Test Partners Ltd


From: Swift, Daniel P.
Date: Thu, Feb 01 2018 11:22AM
Subject: Re: Tabindex and initial focus
← Previous message | Next message →

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

From: Jonathan Avila
Date: Thu, Feb 01 2018 11:25AM
Subject: Re: Tabindex and initial focus
← Previous message | Next message →

> 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 ADDRESS 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.


From: Swift, Daniel P.
Date: Thu, Feb 01 2018 11:32AM
Subject: Re: Tabindex and initial focus
← Previous message | Next message →

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

From: Birkir R. Gunnarsson
Date: Fri, Feb 02 2018 8:17PM
Subject: Re: Tabindex and initial focus
← Previous message | Next message →

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 ADDRESS 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
>
>

From: Ryan E. Benson
Date: Sat, Feb 03 2018 8:53AM
Subject: Re: Tabindex and initial focus
← Previous message | Next message →

This same question came up in another forum I'm in. There was an
overwhelming support of dropping people to the first field. I am torn on
the issue because if you do that, you may miss instructions, or if it is a
basic form, would it have that many instructions? We have PeopleSoft too,
but not many people use it. So if you have a disability, putting focus on
the first element saves you a few seconds, and the screens don't change.

Ryan E. Benson

On Feb 2, 2018 22:17, "Birkir R. Gunnarsson" < = EMAIL ADDRESS REMOVED = >
wrote:

> 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 ADDRESS 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
> >
> >

From: Birkir R. Gunnarsson
Date: Sat, Feb 03 2018 9:04AM
Subject: Re: Tabindex and initial focus
← Previous message | Next message →

My instructions to my team are never to put focus inside the page if
the page is a landing page or if there are important instructions at
the top of the form.
I strongly recommend putting focus directly on a form ield if the page
is a log in page or if this is a form with errors.
Any other situation we treat on a case by case basis.
It's a fact that a screen reader user can get to the top of the page
withone key strok, a keyboard only user may have to tab many times to
get to the first form field (well, unless the page has a skip link).



On 2/3/18, Ryan E. Benson < = EMAIL ADDRESS REMOVED = > wrote:
> This same question came up in another forum I'm in. There was an
> overwhelming support of dropping people to the first field. I am torn on
> the issue because if you do that, you may miss instructions, or if it is a
> basic form, would it have that many instructions? We have PeopleSoft too,
> but not many people use it. So if you have a disability, putting focus on
> the first element saves you a few seconds, and the screens don't change.
>
> Ryan E. Benson
>
> On Feb 2, 2018 22:17, "Birkir R. Gunnarsson" < = EMAIL ADDRESS REMOVED = >
> wrote:
>
>> 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 ADDRESS 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
>> >
>> >

From: Shane Anderson
Date: Thu, Feb 08 2018 8:53PM
Subject: Re: Tabindex and initial focus
← Previous message | Next message →

I'm not sure if I would dismiss this design pattern. Sure, it doesn't work
on general web pages someone visits occasionally, but when dealing with
repeated data entry tasks it can be useful. Needing to navigate to the
first form field with a mouse or tab key could be a big frustration and
waste of time.

The use case should determine if it is used appropriately or not. If it's
meant for repeated daily use (e.g. office staff inputing data 20 times a
day), removing it could hurt the overall experience more than it helps.

Regards
Shane Anderson


On Sat, Feb 3, 2018 at 11:04 AM, Birkir R. Gunnarsson <
= EMAIL ADDRESS REMOVED = > wrote:

> My instructions to my team are never to put focus inside the page if
> the page is a landing page or if there are important instructions at
> the top of the form.
> I strongly recommend putting focus directly on a form ield if the page
> is a log in page or if this is a form with errors.
> Any other situation we treat on a case by case basis.
> It's a fact that a screen reader user can get to the top of the page
> withone key strok, a keyboard only user may have to tab many times to
> get to the first form field (well, unless the page has a skip link).
>
>
>
> On 2/3/18, Ryan E. Benson < = EMAIL ADDRESS REMOVED = > wrote:
> > This same question came up in another forum I'm in. There was an
> > overwhelming support of dropping people to the first field. I am torn on
> > the issue because if you do that, you may miss instructions, or if it is
> a
> > basic form, would it have that many instructions? We have PeopleSoft too,
> > but not many people use it. So if you have a disability, putting focus on
> > the first element saves you a few seconds, and the screens don't change.
> >
> > Ryan E. Benson
> >
> > On Feb 2, 2018 22:17, "Birkir R. Gunnarsson" <
> = EMAIL ADDRESS REMOVED = >
> > wrote:
> >
> >> 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 ADDRESS 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
> >> >
> >> >

From: JP Jamous
Date: Fri, Feb 09 2018 9:59AM
Subject: Re: Tabindex and initial focus
← Previous message | No next message

I second Shane on this one.