Live regions are unpredictable

2 minutes read

Here's one thing I'm struggling with right now.

I've been going through Sara Soueidan's Practical Accessibility course and I've been learning a lot. I mentioned before how it makes me feel like a novice again.

As I'm going through the chapters, I take notes and try to apply what I learn almost immediately. I believe that's the best way to solidify knowledge.

As it happens, this week I was looking at the chapter on live search and how a screen reader announces search results, or lack thereof. Sara links to one of Scott O'Hara's articles where he explores dynamic search results and content. He even has a demo to play with.

I have a search widget on my Daily List archive as well, which doesn't work as well as Scott's. So I thought I could learn a thing or two and get the same sort of interaction on mine.

Here's the rub.

ARIA live regions have timing issues we can't control. Rapid updates to live regions get dropped or batched unpredictably across different assistive technologies. I haven't found a reliable way to make sure every update gets announced.

I noticed the same on Scott's demo, with VoiceOver and Firefox or Safari. Sometimes, VoiceOver will correctly announce the number of results. Sometimes, it'll just not say anything. I can't yet figure out the right conditions to reproduce it consistently. I think this is especially true when you are on a text field (search field included) and an update happens on the page via a live region.

The proper interaction for me would be:

  1. When you type and hit Enter, the form is submitted. I'm not a big fan of auto-submitting to search.
  2. If there are results, the number of results is announced. Optionally, focus is maintained on the input field, or there is a clear quick way to get back to it.
  3. If there are no results, "No results found" is announced. Focus is maintained on the input field, because it means the user will want to search again or clear the search altogether.

I've yet to get this consistent proper interaction for the search on my own site. I might go back to the drawing board and rethink that widget altogether.

But first, the weekend!

Sent on

Did you enjoy this bite-sized message?

I send out short emails like this every day to help you gain a fresh perspective on accessibility and understand it without the jargon, so you can build more robust products that everyone can use, including people with disabilities.

You can unsubscribe in one click and I will never share your email address.