簡體   English   中英

NVDA不在單個網頁上讀取多個aria-live標簽。

[英]NVDA isn't reading multiple aria-live tags on single web page.

我在網頁上使用多個aria-live標簽,並且當網頁上顯示錯誤時,NVDA僅讀取第一個錯誤消息,而不是全部。 我的用戶aria-live =“ assertive”也嘗試過aria-live =“ polite”,但無法正常工作,誰能為它提供一些解決方案。 下面是我的代碼:

<div>
        <input type="text" name="username" tabIndex="0"/>
        <span class="usernameerr" role="alert" aria-live="assertive">Enter User Name</span>
    </div>
    <div>
        <input type="passowrd" name="password" tabIndex="0"/>
        <span class="passworderr" role="alert" aria-live="assertive">Enter Password</span>
    </div>
    <div>
        <input type="text" name="repassword" tabIndex="0"/>
        <span class="repassworderr" role="alert" aria-live="assertive">Renter Password</span>
    </div>
    <div>
        <input type="submit" tabIndex="0"/>
    </div>

幫助將不勝感激。

如果您具有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 。)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM