简体   繁体   English

弹出式窗口和aria-live的可访问性问题

[英]Accessibility issue with popup and aria-live

I have a error message on which I am using aria-live = polite. 我在使用aria-live = polite时收到一条错误消息。 It is announce the first time error is there. 宣布第一次出现错误。 The second time it again announce if I open a popup on that same page and error has occurred in that page. 它第二次再次宣布是否在同一页面上打开弹出窗口,并且该页面已发生错误。

<div aria-live="polite">
<error-message-component></error-message-component>
</div>

I am not able to find why it is happening as it has been already announce to the user and content behind the popup has aria-hidden="true" 我无法找到原因,因为它已经向用户宣布,并且弹出窗口后的内容为aria-hidden =“ true”

So the problem is that the error message (aria-live) is announced twice? 所以问题在于错误消息(aria-live)被宣告了两次? The first time is expected, but if you open a popup, it's announced a second time? 预计会是第一次,但是如果您打开一个弹出窗口,会宣布第二次出现吗?

If you are only specifying aria-live="polite" and are not specifying aria-relevant , then that means the aria-live region should be announced anytime you change text (add, remove, or change text) within the <div> (or any of its child DOM elements), or if you add child DOM elements (but not remove child DOM elements). 如果您指定aria-live="polite" 而不指定aria-relevant ,那么这意味着只要您在<div>()中更改文本(添加,删除或更改文本),就应该宣布aria-live区域。或其任何子DOM元素),或者添加子DOM元素(但不删除子DOM元素)。

So you should confirm that when you display the popup, that no child DOM nodes are added to your aria-live region and that no text within the aria-live region is changed. 因此,您应该确认显示弹出窗口时,没有将子DOM节点添加到aria-live区域,并且在aria-live区域内没有任何文本被更改。

Also check if the aria-live region is somehow referenced by your popup. 还要检查弹出窗口是否以某种方式引用了咏叹调活动区域。 If something in your popup has an aria-labelledby or aria-describedby that points to the aria-live region, then the aria-live region will be announced as part of the popup. 如果您的弹出窗口中的某个区域具有一个aria-labelledbyaria-describedby的aria指向aria活跃区域,那么该aria活跃区域将被宣布为弹出窗口的一部分。

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

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