Skip to content

Implicit combobox role cannot be found #927

@just-boris

Description

@just-boris
  • @testing-library/dom version: v7.30.3
  • Testing Framework and version: react-scripts: 4.0.3
  • DOM Environment: JSDOM

Relevant code or config:

<button aria-haspopup="listbox" aria-expanded="false">
  Select
</button>

The code above has an implicit combobox role, as you can see in the devtools:

Screenshot 2021-04-01 at 21 30 15

However, when I am trying to query it using getByRole("combobox", { name: "Select" }), it does not find a match.

Reproduction:

Here is a codesandbox demo with the repro:

https://codesandbox.io/s/aria-haspopup-demo-nvdty

Suggested solution:

There was a PR mentioning this issue:
#406

However, in the end it was discarded in favor of another one and did not fix the issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions