WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Partial Tabindex Behavior

for

From: David Ashleydale
Date: Jul 18, 2014 1:33PM


Yes, you can think of elements with no tabindex attribute as having
tabindex="infinite".
So if there are some elements on the page with tabindex set, the focus will
go through all of those first, in numerical order. If two or more items
have the same value, focus goes through them in source code order. After
focus goes to each of those, focus will then go to the first item on the
page in source code order that has no tabindex. And it will go to the
remaining items in source code order.

This is why I usually recommend that if tabindex is used on a page (which
should actually be avoided), you should give everything on the page a
tabindex. Although that's a nightmare to maintain.

David

On Friday, July 18, 2014, Jukka K. Korpela < <EMAIL REMOVED> > wrote:

> 2014-07-18 20:46, James Bailey wrote:
>
> I evaluated a page and the code contained focusable elements, some
>> with Tabindex set to values > 0 and some without. It seems that
>> elements with a Tabindex are ordered before elements with no
>> Tabindex. Is that correct?
>>
>
> That's what happens in practice. The specs are somewhat obscure. HTML 4.01
> does not explicitly say this:
> http://www.w3.org/TR/REC-html40/interact/forms.html#adef-tabindex
> But it might be read so that when the tabindex attribute is not present,
> it is defaulted to 0 (though this is not stated explicitly in the spec),
> and thus such elements fall into category 2 (elements that do not support
> tabindex or have it set to 0), which is navigated, in textual order, after
> elements with a positive tabindex.
>
> HTML5 is obscure in this issue, too:
> http://www.w3.org/TR/html5/editing.html#focus-management
>
> It can be argued that it is safer to assign tabindex to all focusable
> elements if it is used at all. But this would just avoid the theoretical
> ambiguity, so it's not important in practice.
>
> Yucca
>
> > > >