Comment by miki123211

Comment by miki123211 19 hours ago

0 replies

As a screen reader user, I think aria live regions (and hence the output tag) were actually a mistake.

What we should have had instead is a `document.speak(text, priority)` method, which would just pass the text straight through to the screen reader.

Sure, that approach is less pure, yet it is far more pragmatist and practical, as you only need aria when you heavily use js anyway.

Aria live regions, as they currently stand, basically encourage three anti-patterns:

First is the "if it changes, it should be announced" anti-pattern, think e.g. a constantly changing stock ticker on a news website. People make these into aria live regions because "it's live, we want to be good citizens and do semantics, right?". Sites that do this are almost impossible to use, as you're constantly distracted by the ticker. Another instance of this are timers that change every second. With a `document.speak` method, it would be far more obvious that you don't want the screen reader to announce the ticker every time it changes.

The second anti-pattern is the one of outputting the same message twice. Think a calculator where the user executes two different expressions which both produce a result of 0. The result of the second expression won't be announced, as there will be no change to the live region contents. With `document.speak`, this wouldn't be a problem, as the method would just be executed twice.

The third anti-pattern is actually somewhat specific to the `output` tag. It's very tempting to use it for terminal, log and chat outputs, and that is a mistake. Those processes append to the output instead of replacing it, but with the aria status of atomic, the entire output area would be announced every time the output changes.