WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Where do single page applications fail WCAG2?

for

From: Lynn Holdsworth
Date: Feb 10, 2015 6:16AM


Thanks Patrick. I've written a few SPA's, and all I did was change the
page title and drop focus on the H1 heading. That's what I was
planning to advise these guys to do, but I just wasn't sure where (or
even whether) to fail this one. I'll probably fail it under 3.2.2, and
probably also 2.4.3.

Best, Lynn

On 10/02/2015, Patrick H. Lauke < <EMAIL REMOVED> > wrote:
> 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
> > > >