Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<summary> not activatable if it has descendant <input> #12008

Open
Malvoz opened this issue Jan 23, 2021 · 3 comments
Open

<summary> not activatable if it has descendant <input> #12008

Malvoz opened this issue Jan 23, 2021 · 3 comments

Comments

@Malvoz
Copy link

Malvoz commented Jan 23, 2021

Steps to reproduce:

  1. Open the following HTML in a browser:

    <details>
      <summary>
        <label>
          <input type="checkbox" checked>
          <span>accessible name</span>
        </label>
      </summary>
      <p>content</p>
    </details>
  2. Tab (once) to focus the <summary> element
  3. Press Enter or Space

Actual behavior:

Details element is not opened, instead the input element is toggled.

Expected behavior:

Details element should be opened.

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

2020.3

Windows version:

10.0.19042 build 19042

Name and version of other software in use when reproducing the issue:

Chrome 88.0.4324.104

@Malvoz
Copy link
Author

Malvoz commented Jan 24, 2021

The HTML spec currently states that phrasing content (including interactive content such as label and input) is allowed in summary. That may change, per whatwg/html#2272. I believe this should be considered a bug regardless (I'm assuming this is a bug, I'm not an advanced screen reader user) since nothing prevents authors from nesting interactive elements inside summary.

cc @JAWS-test

@JAWS-test
Copy link

@Malvoz

You are right. It is a screen reader bug (NVDA and JAWS), but it results from a bug in the HTML specification. As long as the HTML bug exists, screen readers should correctly output and operate elements within summary, especially since Chrome correctly passes the role of the checkbox to the Accessibility API.

Until the bug is fixed, all web developers are advised to use only plain text in the summary and no structured text or interactive elements.

@Adriani90
Copy link
Collaborator

Test case:
https://codepen.io/stevef/pen/NWooyJr

It seems in Firefox it works as expected with NVDA 2024.1 RC1, the control for expanding and colapsing the element is rendered on a separate line in browse mode and it is reachable by tab in focus mode.

However, in Chrome the summary element is merged with the link and it cannot be navigated with the keyboard. I can however colaps and xpand the summary element without touching the link by using the mouse.

Not sure whether Chromium exposes something wrong here or NVDA behaves unexpected. cc: @jcsteh do you have any details how this was solved in Firefox?

cc: @aleventhal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants