Connor.Littleton
Connor.Littleton

Reputation: 147

Dealing with TWO aria-live "assertive" regions to be read to completion

Is there a way to enforce two aria-live="assertive" regions to be read to completion? It doesn't matter what order they are read in just as long as they are both read to completion.

I have a simple form, where the submit button has aria-live="assertive" (for complicated reasons this cannot be changed). I also have an error message that appears whenever there is an error submitting the form.

Right now, the error message is never read even when aria-live="assertive" is added because assistive technologies are just reading the buttons message and then flushing the queue.

Upvotes: 2

Views: 966

Answers (1)

QuentinC
QuentinC

Reputation: 14722

You have no way to know if reading has been interrupted in the middle, or if it has been done from beginning to end. You can't make sure it will be the case either. By the way, nor you can now if the message has been read, is currently being read, or has been scheduled to be read slightly later.

The usual behavior of assertive mode is to speak the message as soon as possible, interrupting whatever else if needed. For all the rest, nothing is specified. In particular, if you have two assertive live regions, you have no way to tell which one should take priority over the other, or if they should rather be read both in succession.

From there, you have two possibilities:

  • Use a single assertive region at once
  • Use polite live regions instead of assertive

It shouldn't create troubles to have multiple polite live regions, as they normally don't interrupt each other. For error messages, polite should be sufficient, if they are well implemented.

Upvotes: 3

Related Questions