Closed TrevorRice closed 8 months ago
Uh oh! @TrevorRice, the image you shared is missing helpful alt text. Check your issue body.
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.
Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
Apologies, this turned out to an issue with how we were using a Floating UI hook.
@testing-library/dom
version:8.13.0
@testing-library/jest-dom
version:5.16.4
@testing-library/react
version:13.2.0
Relevant code or config:
I have an
Option
component that simply wraps itschildren
in a<div role="option">
:What you did:
I've been trying to query for a specific option via
getByRole
in my unit tests:What happened:
I receive the following error:
Despite the element's accessible name being "Dog" as demonstrated by inspecting the accessibility tree:
Reproduction:
Problem description:
getByRole
does not seem to respect an element's accessible name when not explicitly defined via a method likearia-label
oraria-labelledby
.Suggested solution:
I would expect the
name
option to respect an element's accessible name regardless of how it was constructed.Please let me know if I'm totally overlooking something!