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

computeAccessibleName won't compute button name from child title #1016

Open
Cipscis opened this issue Nov 27, 2023 · 1 comment
Open

computeAccessibleName won't compute button name from child title #1016

Cipscis opened this issue Nov 27, 2023 · 1 comment

Comments

@Cipscis
Copy link

Cipscis commented Nov 27, 2023

Elements with the "button" role support determining their accessible name from their content, and it's possible for internal elements to have no text content but instead specify their accessible name via a "title" attribute. For example:

<button>
    <span title="Name from child title"></span>
</button>

This can come up, for example, when using internal elements that display an icon.

Unfortunately, calling computeAccessibleName on such a button returns an empty string, whereas it should return 'Name from child title'. The correct title can be viewed, for example, in the accessibility tree of Chrome devtools:

image
image

Calling computeAccessibleName on the inner element returns the correct accessible name.

I've set up a replication in Codepen: dom-accessibility-api accessible name bug reproduction

@neaumusic
Copy link

neaumusic commented Dec 14, 2023

Yep having this same issue -- check out a hackernews 'upvote' button/link, you'll notice the title is not included in the computed accessible name nor description

I think #1020 might resolve the issue

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

2 participants