简体   繁体   English

处理两个 aria live 自信的区域

[英]Dealing with TWO aria live assertive regions

Is there a way to enforce two aria-live="assertive" regions to be read to completion?有没有办法强制两个aria-live="assertive"区域被读取完成? It doesn't matter what order they are read in just as long as they are both read to completion.只要它们都被阅读完成,它们的阅读顺序无关紧要。

A have a simple form, where the submit button has aria-live=assertive (for complicated reasons this cannot be changed). A 有一个简单的表单,其中提交按钮具有aria-live=assertive (由于复杂的原因,无法更改)。 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.现在,即使添加了aria-live="assertive"也不会读取错误消息,因为辅助技术只是读取按钮消息然后刷新队列。

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 .对于所有 rest,没有指定任何内容 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.对于错误消息,礼貌应该足够了,如果它们得到很好的实施。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM