WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Where do single page applications fail WCAG2?

for

From: Patrick H. Lauke
Date: Feb 10, 2015 6:05AM


On 10/02/2015 12:40, Lynn Holdsworth wrote:
> Hi Patrick,
>
>> This sounds more like the focus is actually lost, rather than being programmatically set to the newly shown content.
>
> But is it? If we're mimicking a new page load, which is surely what
> SPA's are doing, shouldn't the focus behave in the same way as it
> would if we'd reached a new page?

When a completely new page loads, browsers notify screenreaders (that a
page load is in progress, when it's finished, etc) and then the browser
itself explicitly resets the focus. In your case, the focus isn't
reset...it just sits in limbo (after what was originally focused was
hidden/removed from the page's DOM/accessibility tree). So it *does*
need to be explicitly moved - to the start of the document, if that's
the most sensible place for it, but still programmatically.

> I wish I knew what event causes screenreaders to read new pages and
> not significant amounts of new content. Then perhaps we could fire off
> that event.

There is no relevant event that can be fired, I'm afraid. But the above
will do the job.

P
--
Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke