WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Partial Tabindex Behavior

for

From: Birkir R. Gunnarsson
Date: Jul 19, 2014 12:51PM


This is correct, but note that in some browsers shift-tabbing and
tabbing through elements with positive tabindexies gives inconsistent
results (at least I ahve seen tht with screen readers).

Whenever you see positive tabindex being used, I would recommend
calling that out as a potential user issue and recommend that it be
avoided at all cost.
tabindex-'-1' for use with Javascript or on non-focusable anchors that
are targets of skip links is fine, tabindex="0" on elements that are
made up of divs, spans or other non-focusable elements (along with
sufficient keyboard interaction and aria role mapping) is acceptable,
when necessary,
but I have never seen a convincing argument for using positive tabindex values.
It means the source code order is messed up, it causes maintenance
head aches and you risk confusing the users and having inconsistent
keyboard interactions.
I like what the Goodwitch has to say on it (though WebAIM, of course,
has a good overview on this as well, as do many other accessibility
gurus):
http://www.glendathegood.com/blog/?p=604
Cheers

On 7/18/14, David Ashleydale < <EMAIL REMOVED> > wrote:
> 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
>>
>> >> >> >>
> > > >


--
Work hard. Have fun. Make history.