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

A11y role assignment for draggable items with nested interactive elements #120

Open
vBenTec opened this issue Nov 29, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@vBenTec
Copy link

vBenTec commented Nov 29, 2024

In the current version (0.2.5), draggable items are automatically assigned the role="option". This role assignment creates accessibility issues when draggable items contain nested interactive elements, such as buttons or links. Since role="option" implies a selectable item within a listbox, it restricts interactive behavior inside the item.

Problem:

  • Nested Elements Conflict: Interactive elements (e.g., buttons, links) within the draggable item are not accessible as expected when role="option" is enforced.
  • Lack of Customization: There is no option to disable or customize the assigned role, which limits the flexibility of the package in complex UIs.

Proposed Solution:

Allow developers to customize or disable the role for draggable items.
Automatically set a more appropriate role (e.g., role="group") when nested interactive elements are detected.

Example Use Case:
In our application, we have draggable taskbar items containing a link and a remove button. The current role assignment prevents proper accessibility and usability of these nested buttons. Our axe integration test fails due to this issue.

@sashamilenkovic sashamilenkovic self-assigned this Nov 29, 2024
@sashamilenkovic sashamilenkovic added bug Something isn't working enhancement New feature or request labels Nov 29, 2024
@sashamilenkovic
Copy link
Contributor

@vBenTec This is a good point. We should definitely allow more overrides for accessibility use-cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants