WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: programmatically setting focus on page load

for

From: deborah.kaplan
Date: Jul 1, 2015 5:29PM


Depending on the page, it can be argued to violate 2.4.3, Focus order. If you arrive in the middle of the page, that's an illogical focus order.

Personally I find it always to be a keyboard/voice accessibility roadblock unless (1) all content is visible without needing to scroll down, (2) the form is the only thing you're likely do on the page, and (3) on a mobile screen, someone will not have a problem clicking a part of the screen that is not the input form field.

When you're using a keyboard, and you arrive in a page that has autofocus, you suddenly discover that none of your usual commands are working (especially if the visual focus is not obvious). You can't page down, you can select any page elements, you can't move around the page until you realize that you are in a focused text box. On a mobile device, you load the page and are automatically in a keyboard view, which might take up most of the page.

Here's an example of a page with multiple many, many links which you might want to activate, but where the form field is automatically activated on every page load or form submission: http://www.worldcat.org/search?qt=worldcat_org_all&;q=smekday

Deborah Kaplan

On Wed, 1 Jul 2015, Paul J. Adam wrote:

> Hey Jennison, if it's the login page or the home page and the main task for a user is to login to the site then that makes sense as the fastest way to get the user into their main goal.
>
> I use the HTML5 autofocus attribute on my personal contact form so that puts your focus there automatically because I decided that's the main goal of that page. http://pauljadam.com/#/contact <http://pauljadam.com/#/contact>;
>
> Autofocus is much better than using positive tabindex values which break the focus order most times.
>
> So no I would not call it a WCAG Success Criterion failure.
>
> Paul J. Adam
> Accessibility Evangelist
> www.deque.com
>
> Join us at our Mobile Accessibility "Bootcamp!"
> August 6-7 in Austin Texas
> https://dequeuniversity.com/events/2015/mobile
> Topics include responsive web design, native apps, & more
>
>> On Jul 1, 2015, at 5:10 PM, Jennison Mark Asuncion < <EMAIL REMOVED> > wrote:
>>
>> Hi,
>>
>> If a page loads, and focus is programmatically set, say to go directly
>> to a User Name field (i.e., a screen reader user would be unaware of
>> any content above), does that make the page nonconformant with WCAG?
>> My gut is saying it does, but I am unsure and need a sanity check and
>> the guideline reference (if my gut is right).
>>
>>
>>
>> Jennison
>> >> >> >> >
> > > > --