Open Bug 1762999 Opened 3 years ago Updated 3 years ago

Intervening divs with ids reports incorrect listbox options count to NVDA

Categories

(Core :: Disability Access APIs, defect)

Firefox 98
defect

Tracking

()

UNCONFIRMED

People

(Reporter: nlawson, Unassigned)

References

Details

Attachments

(4 files)

Attached image nvda-firefox.png (deleted) —

Steps to reproduce:

  1. Enable NVDA screen reader in Windows 10
  2. Go to https://bl.ocks.org/nolanlawson/raw/e63d2261406a15900ec6bd90e150e4b6/
  3. Click the text input
  4. Type "b"
  5. Press up and down on the keyboard to cycle through dropdown options

Actual results:

NVDA speaks "1 of 1" for every list option.

Expected results:

NVDA should speak "1 of 5", "2 of 5", etc., because there are 5 total options.

The correct output is observed in Chrome+NVDA (Windows) and Chrome+VoiceOver (MacOS). This appears to be a Firefox-only issue.

This issue also only occurs if an ID is added to the element with style="display: contents". The HTML looks like this:

<ul aria-labelledby="ex1-label" role="listbox" id="ex1-listbox" class="listbox">
    <div id="id-31e9d5" style="display: contents;">
        <li class="result" role="option" id="result-item-0">Banana</li>
    </div>
    <div id="id-5ef236" style="display: contents;">
        <li class="result" role="option" id="result-item-1">Beets</li>
    </div>
    <!-- etc. -->
</ul>

(Note the "id" on the <div>s with style="display: contents;".)

In the JavaScript, you can remove this line (which adds the ID) and observe that Firefox behaves correctly afterwards:

resultWrapper.id = 'id-' + Math.floor(Math.random() * 10000000).toString(16)
Attached image nvda-chrome.png (deleted) —
Attached image voiceover-chrome.png (deleted) —
Attached file repro.zip (deleted) —

The Bugbug bot thinks this bug should belong to the 'Core::Disability Access APIs' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Disability Access APIs
Product: Firefox → Core
Severity: -- → S3

This is related to the intervening divs rather than display: contents. A workaround is to put role="presentation" on the intervening divs. This isn't ideal - it's certainly a bug in Firefox - but I mention it in case it's useful as a temporary measure.

Depends on: 995064
Summary: display:contents reports incorrect listbox options count to NVDA → Intervening divs with ids reports incorrect listbox options count to NVDA
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: