WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Tabindexing question

for

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

From: Nancy Johnson
Date: Fri, Jan 20 2012 11:42AM
Subject: Tabindexing question
No previous message | Next message →

I have a web application full of controls..

I set the tabindex ="1" to the first control.

The navigation is global and there is no tab indexing, but would like
to give the user the option of the navigation before the user gets to
the first control.

If I set the tabindex to the first control, the focus immediately goes
there and skips the navigation.

Is there a remedy?

Thanks,

Nancy

From: Patrick H. Lauke
Date: Fri, Jan 20 2012 11:48AM
Subject: Re: Tabindexing question
← Previous message | Next message →

On 20/01/2012 18:42, Nancy Johnson wrote:
> I have a web application full of controls..
>
> I set the tabindex ="1" to the first control.
>
> The navigation is global and there is no tab indexing, but would like
> to give the user the option of the navigation before the user gets to
> the first control.
>
> If I set the tabindex to the first control, the focus immediately goes
> there and skips the navigation.
>
> Is there a remedy?

Don't use tabindex?

--
Patrick H. Lauke

From: Jared Smith
Date: Fri, Jan 20 2012 11:57AM
Subject: Re: Tabindexing question
← Previous message | Next message →

On Fri, Jan 20, 2012 at 11:42 AM, Nancy Johnson wrote:

> I set the tabindex ="1" to  the first control.

tabindex with positive values is almost universally a bad idea. I very
rarely find cases where this doesn't make accessibility worse.

> If I set the tabindex to the first control, the focus immediately goes
> there and skips the navigation.
>
> Is there a remedy?

If the navigation is before the controls, then you don't need to do
anything. It will naturally be present in the navigation order before
the controls.

If you want the user to start at a place other than the top of the
page, you should consider that this may be confusing to users because
it will be different than other pages on the site. But if you require
this, you can either restructure the underlying HTML code and use CSS
to present the stuff you want first at the beginning of the markup
(this could be confusing to sighted users who may be confused by the
odd keyboard navigation order), or you could use JavaScript focus() to
set focus to the element you want when the page loads.

Jared Smith
WebAIM.org

From: Patrick H. Lauke
Date: Fri, Jan 20 2012 12:21PM
Subject: Re: Tabindexing question
← Previous message | No next message

On 20/01/2012 18:57, Jared Smith wrote:
> or you could use JavaScript focus() to
> set focus to the element you want when the page loads.

or use the new-ish HTML5 autofocus attribute (with a JS fallback if it's
not supported), if you really want to be fancy. But yes, fundamentally,
it seems that your requirements are contradictory...you have tabindex,
but you want other things before it to be focused first? It still sounds
to me like you don't actually want to do anything special and rely on
standard tab order?

P
--
Patrick H. Lauke