NVDA isn’t reading multiple aria-live tags on single web page.
我在网页上使用了多个 aria-live 标签,当网页上显示错误时,NVDA 只读取第一条错误消息,而不是全部。
我有用户 aria-live=”assertive” 也尝试过使用 aria-live=”polite” 但无法正常工作,任何人都可以为它提供一些解决方案。
以下是我的代码:
1
2 3 4 5 6 7 8 9 10 11 12 13 |
<input type=“text” name=“username” tabIndex=“0”/>
<span class=“usernameerr” role=“alert” aria–live=“assertive”>Enter User Name</span> <input type=“passowrd” name=“password” tabIndex=“0”/> <span class=“passworderr” role=“alert” aria–live=“assertive”>Enter Password</span> <input type=“text” name=“repassword” tabIndex=“0”/> <span class=“repassworderr” role=“alert” aria–live=“assertive”>Renter Password</span> <input type=“submit” tabIndex=“0”/> |
我们将不胜感激。
- 一个有用的链接:ux.stackexchange.com/questions/72271/…
如果你有 role=alert,那意味着 aria-live=assertive。当您拥有 aria-live=assertive 时,屏幕阅读器可能会清除待处理消息的队列。因此,如果您有三个自信的区域,它们可能会相互踩踏并清除其他消息。最后一个可能会赢。
参见 https://www.w3.org/TR/wai-aria-1.1/#aria-live。它说”用户代理或辅助技术可以选择在发生断言更改时清除排队的更改。”
因此,您可能会听到一个屏幕阅读器而不是另一个屏幕阅读器的问题。您可以通过删除 role=alert 并将 aria-live 更改为 polite 来测试它。 (你说你用 aria-live=polite 尝试过,但如果你没有删除 alert 角色,那么它仍然是 assertive。)
- 尝试删除 role=”alert” 并添加 aria-live=”polite” 但不读取任何标签。只有当有 role=”alert” 时,只有 NVDA 读取第一次出现。也只有 aria-live=”assertive” 也不会读取。
- 我仍然存在同样的问题,尝试使用 aria-live=”polite” 并在 chrome 浏览器中使用 NVDA 运行,但它不起作用。任何人都可以帮助我解决问题。
- 过去,chrome 不完全支持 aria-live,因此它可能是浏览器错误。当我过去在 chrome 上进行测试时,一个版本可以工作,而下一个版本则不行。这是不一致的。 Chrome 通常不是屏幕阅读器的高优先级平台。许多公司使用 Internet Explorer 测试 JAWS,使用 Firefox 测试 NVDA 以及 iOS(和 Mac)上的 Voiceover。您当然可以在 chrome 上测试 JAWS 和 NVDA,但如果某些东西不起作用,请确保您在其他浏览器/AT 组合上进行测试,因为您的代码可能是正确的,而 chrome 可能是错误的。
来源:https://www.codenong.com/50213039/