Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent reading every dynamic change: is there an aria-live="zombie"?

I have a <div> tag where I’m updating the text every few milliseconds. Visually, I can see the text flashing by, which is good.

I want to make it an aria-live region so I can hear the text flashing by too, but I don’t want JAWS to read every text change. It'll get too bogged down.

So if I change the text 4 times by the time jaws finishes reading the first change, I want jaws to ignore the other 3 changes and to just say the next change (5th change), and so on. The missed 3 changes aren't important.

So I sort of have an aria-live region that's not really alive and it's not really dead. I need some kind of zombie middle ground.

I've tried various combinations of 'polite' and 'assertive' as well as aria-busy but nothing I've tried works.

Any ideas?

like image 690
slugolicious Avatar asked Oct 30 '22 18:10

slugolicious


1 Answers

You can keep an empty <div aria-live="polite"></div> in the bottom of your document. Then inject a copy of the text you want to say at certain intervals into the aria-live div and then remove the text from the aria-live div a second or so later.

Be careful how you use it though. I could see examples of usage being announcing percentage of loading, or for a live population counter where you may want to announce it every couple of seconds or so.

For the most part though let the screen-reader do what it's meant to do. Sometimes we over-think a solution.

like image 81
haltersweb Avatar answered Nov 15 '22 07:11

haltersweb