admin管理员组

文章数量:1122846

we are trying to get the screen reader to announce the alert that appears on screen when a user makes a booking for a time that is not available

Below is a screen shot of the alert and the code behind

<div id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsDv" class="suggestions" role="alert" style="visibility: visible;">
            <ul id="itemsList" class="itemsList" role="presentation">
            
                    <li>
                        <p class="h3">Clashes with site open times</p>
                        <p>The booking of Acer Aspire Switch 11 must start and end in available time.</p>
                    </li>
                
                    <li id="expandItemsList" style="display: none;">
                        <a href="#">Show more</a>
                    </li>
                    <li id="shrinkItemsList" style="display: none;">
                        <a href="#">Show less</a>
                    </li>
            </ul>
            <table id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsCtrl_suggRpt" cellspacing="0" role="presentation" style="border-collapse:collapse;">
    <tbody><tr>
        <td colspan="3">
    <p class="h3">Suggested times</p>
  </td>
    </tr><tr>
        <td>
      <a id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsCtrl_suggRpt_ctl01_suggLnk" class="icon" href="#" data-href="04"><img src="/connectmain/icons/table.gif" alt="" role="presentation">22/11/2024 11:30 - 12:00</a>
  </td><td>
      <a id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsCtrl_suggRpt_ctl02_suggLnk" class="icon" href="#" data-href="05"><img src="/connectmain/icons/table.gif" alt="" role="presentation">22/11/2024 11:30 - 13:00</a>
  </td><td>
      <a id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsCtrl_suggRpt_ctl03_suggLnk" class="icon" href="#" data-href="06"><img src="/connectmain/icons/table.gif" alt="" role="presentation">22/11/2024 13:00 - 13:30</a>
  </td>
    </tr>
</tbody></table>
        </div>

but rather that reading the 3 suggested times once it reads the 3 times as can be seen in the NVDA speech log

Does any one have any ideas why this would do this, bug in NVDA or am i missing something obvious in the code

Thanks

we are trying to get the screen reader to announce the alert that appears on screen when a user makes a booking for a time that is not available

Below is a screen shot of the alert and the code behind

<div id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsDv" class="suggestions" role="alert" style="visibility: visible;">
            <ul id="itemsList" class="itemsList" role="presentation">
            
                    <li>
                        <p class="h3">Clashes with site open times</p>
                        <p>The booking of Acer Aspire Switch 11 must start and end in available time.</p>
                    </li>
                
                    <li id="expandItemsList" style="display: none;">
                        <a href="#">Show more</a>
                    </li>
                    <li id="shrinkItemsList" style="display: none;">
                        <a href="#">Show less</a>
                    </li>
            </ul>
            <table id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsCtrl_suggRpt" cellspacing="0" role="presentation" style="border-collapse:collapse;">
    <tbody><tr>
        <td colspan="3">
    <p class="h3">Suggested times</p>
  </td>
    </tr><tr>
        <td>
      <a id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsCtrl_suggRpt_ctl01_suggLnk" class="icon" href="#" data-href="04"><img src="/connectmain/icons/table.gif" alt="" role="presentation">22/11/2024 11:30 - 12:00</a>
  </td><td>
      <a id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsCtrl_suggRpt_ctl02_suggLnk" class="icon" href="#" data-href="05"><img src="/connectmain/icons/table.gif" alt="" role="presentation">22/11/2024 11:30 - 13:00</a>
  </td><td>
      <a id="ctl00_ctl00_MainContent_MainWizardContent_suggestionsCtrl_suggRpt_ctl03_suggLnk" class="icon" href="#" data-href="06"><img src="/connectmain/icons/table.gif" alt="" role="presentation">22/11/2024 13:00 - 13:30</a>
  </td>
    </tr>
</tbody></table>
        </div>

but rather that reading the 3 suggested times once it reads the 3 times as can be seen in the NVDA speech log

Does any one have any ideas why this would do this, bug in NVDA or am i missing something obvious in the code

Thanks

Share Improve this question asked Nov 22, 2024 at 11:53 Craig WalkerCraig Walker 4445 silver badges9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

My testing is showing that this is working properly with NVDA/Chrome but is producing the behavior you described with NVDA/Firefox. I was able to fix this by using aria-live=assertive instead of role=alert. I'm assuming there is a bug in NVDA when used with Firefox that is causing it to read the link text three times in alert roles.

本文标签: accessibilityNVDA reading links 2 or 3 times in an alertStack Overflow