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

chore: update roles with interactive info #2517

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/standards-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ The [`ariaRoles`](../lib/standards/aria-roles.js) object defines valid ARIA role
- `allowedAttrs` - array(optional). List of allowed attributes (besides any required and global ARIA attributes).
- `nameFromContent` - boolean(optional. Default `false`). If the role allows name from content when calculating the accessible name.
- `unsupported` - boolean(optional. Default `false`). If the role role is unsupported. Use this property to disable a role.
- `contentTypes` - array(optional). List of [content types](https://www.w3.org/TR/html-aria/#allowed-aria-roles-states-and-properties) for the role. Valid values are:
- `flow`
- `document`
- `heading`
- `phrasing`
- `interactive`
- `interactiveDescendant` - boolean(optional. Default `true`). If the role is allowed to have interactive descendants.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is exclusively based on whether contentType includes "interactive", this is redundant. I'm not sure this is the right solution though. What I was thinking is to look at ARIA's "presentational children" property. The issue isn't that screen readers just don't know how to deal with nested interactive elements. It's that anything you put inside of an element with presentational children will not be included in the accessibility tree. Not just interactive stuff either:

The image in this button is not in the accessibility tree. This button wouldn't be announced as having an image inside it. But if you put role=link on the button, it will be.

<button><img src="..." alt="hello" /></button>

There are interactive elements that require other interactive children. Combobox and listbox jump to mine. I suspect you can also do it with links without causing accessibility problems. ARIA definitely says you can, but we should probably test that to be sure.


### Dpub Roles

Expand Down
Loading