WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Having an application element gain focus when the page loads?

for

From: Brandon Keith Biggs
Date: Mar 12, 2018 11:07AM


Hello,
The app is similar to a game, where all the keyboard input needs to be
passed to the element.

<div role="application">
<input type="button" autofocus="true"/>
</div>

seems to work really well.
Is there an advantage to using tabindex rather than autofocus?
Thanks,


Brandon Keith Biggs <http://brandonkeithbiggs.com/>;

On Mon, Mar 12, 2018 at 9:44 AM, Jonathan Avila < <EMAIL REMOVED> >
wrote:

> > Or does the page also contain other things that are outside of the
> application area, but you'd want THAT to be accessed first?
>
> I would strongly advise against using the role application on a body
> element. The application role should only be reserved for specific widgets
> where no other role fits and keys need to be passed through from the screen
> reader to the content. Use of application mode is often misused and limits
> the user's access and in my opinion often is a flag for an application that
> was designed by people who do not understand who users who are blind or
> visually impaired use screen readers, quick navigation keys, and other
> features.
>
> There may be some specific situations where it is appropriate for the body
> element but it would be extremely limited.
>
> Jonathan
>
> Jonathan Avila
> Chief Accessibility Officer
> Level Access
> <EMAIL REMOVED>
> 703.637.8957 office
>
> Visit us online:
> Website | Twitter | Facebook | LinkedIn | Blog
>
> See you at CSUN in March!
>
>