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

Duplicate aria-describedby="-live-region" IDs for multiple drag-and-drop containers #111

Open
vBenTec opened this issue Oct 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@vBenTec
Copy link

vBenTec commented Oct 22, 2024

Description:

After updating to v^0.2.4, we encountered an issue where the parent container for drag-and-drop elements is assigned aria-describedby="-live-region". A live region div is then inserted at the root of the document with the same ID (-live-region), causing duplicate IDs when multiple drag-and-drop containers are present on the same page.

It appears that all instances are sharing the same div, as the first occurrence in the DOM is being used for announcements while dragging. However, the repeated use of the same ID could lead to conflicts.

<div aria-live="polite" aria-atomic="true" data-drag-and-drop-live-region="true" id="-live-region" style="position: absolute; width: 1px; height: 1px; padding: 0px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border: 0px;"></div>
<div aria-live="polite" aria-atomic="true" data-drag-and-drop-live-region="true" id="-live-region" style="position: absolute; width: 1px; height: 1px; padding: 0px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; border: 0px;"></div>

Suggested Improvement:

Implement a guard that checks if the live region div has already been appended to the document. This would prevent additional drag-and-drop containers from attempting to insert a duplicate live region, while ensuring that all instances share the first one for updates mind SSR.

@sashamilenkovic sashamilenkovic self-assigned this Oct 22, 2024
@sashamilenkovic sashamilenkovic added the bug Something isn't working label Oct 22, 2024
@Frallen
Copy link

Frallen commented Nov 5, 2024

In my project, the screen has fixed values and since div aria-live="polite" has width and height dimensions, I get a scroll.

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

No branches or pull requests

3 participants