Skip to content
easeweb
Search topics

Search and filter results that update without a word

A live product search rewrites its result count as people type, but the line is in no live region, so a screen reader never says it.

WCAG 2.2
SC 4.1.3AA· new in 2.1
Required by
EN 301 549 (EU)
Broken count.textContent = countText(products.length, words);
The accessibility problem illustrated: No vision:Did the search find anything?
01

The problem

Screen reader users type a search or tick a filter and can't tell whether the results changed, how many there are, or that nothing matched

02

Try it

Search for apron, stop, and listen

The panel shows what a screen reader announces after each search. Is the number of products ever heard? Try a word nothing matches too.

Broken Can you fix this?

BrokenA count line that changes on screen only

Showing all 6 products

  • Linen apron
  • Canvas apron
  • Child's apron
  • Tea towels, set of 3
  • Oven gloves
  • Bread tin

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Announce the count from a status region once results are in

Before
BrokenA count line that changes on screen only
<label for="q">Search products</label><input type="search" id="q"><p id="result-count">Showing all 6 products</p><ul id="results">…</ul>
What is wrong1 point

The words are right and they sit in the right place. One thing is wrong.

  • A screen reader user never hears the count. The p is not a live region, so the change is drawn on screen and never announced.
After

The visible count as a status region

<label for="q">Search products</label><input type="search" id="q"><p id="result-count" role="status">Showing all 6 products</p><ul id="results">…</ul>
How it is fixed2 steps
  1. Give the count line role="status". It was already on the page, outside the list that is redrawn, so it becomes a polite live region the browser is watching from the start. After the pause, the screen reader finishes what it is saying, then reads "3 products found for apron". The caret stays in the field.
  2. Write the count through say, which clears the line first when the words are the same, so the change is still announced.

This fixes the Before and passes 4.1.3. What is heard is always the line that is shown, and the only new code is the attribute and the say helper. This works only while the count line itself survives each search: if the page rebuilds it along with the results, use the region below instead.

Easily confused
04

Verify the fix

4 checks, no mouse.

Test with: Screen reader, Keyboard

0 of 4 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the search component, the results template or the page layout changes.

How screen readers handle role="status"

Limits

Live regions behave differently across screen readers and browsers, and some drop a polite message when people keep typing. This pattern covers one search field on one page. Saved-draft messages are covered in status messages that are shown but never announced, and a row of filter links that redraws the list in place, with the mark on the chosen one, in filter links that don't say which is chosen or what changed; infinite scroll and Load more are a loading topic of their own. Test your real search, with its real filters, sorting and pagination, with the screen readers your users use.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service