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

DropdownItem looses menuitem role when disabled #2759

Open
DavidCasillasRivero opened this issue Jun 15, 2023 · 1 comment
Open

DropdownItem looses menuitem role when disabled #2759

DavidCasillasRivero opened this issue Jun 15, 2023 · 1 comment

Comments

@DavidCasillasRivero
Copy link

  • components: DropdownItem
  • reactstrap version ^8.9.0
  • import method es
  • react version ^17
  • bootstrap version ^4.6

What is happening?

When a DropdownItem has the property disabled={true} it is not rendered including the menuitem role. When writing tests you have to target a different role to find the element getByRole('menuitem) vs getByRole('button').

What should be happening?

The menuitem role should not depend on the disabled status of the component.

Steps to reproduce issue

You can check the issue in the Reacstrap site
https://reactstrap.github.io/?path=/docs/components-dropdown--dropdown#uncontrolled

@acelaya
Copy link

acelaya commented Sep 25, 2023

Adding to this, it is not only a problem in tests. From an accessibility point of view, it also becomes an invalid role inside a role="menu" container, which does not allow role="button" children.

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