grid-js / gridjs

Advanced table plugin
https://gridjs.io
MIT License
4.33k stars 235 forks source link

IDs are not unique - Violation of SIA-R3 #1406

Open alvaropmontenegro opened 6 months ago

alvaropmontenegro commented 6 months ago

Hi! I've recently been analyzing the Container.tsx code, and I noticed a potential issue related to duplicate IDs that may impact accessibility. In the Container component, there's a static ID, "gridjs-temp" associated with a div element:

https://github.com/grid-js/gridjs/blob/6275e018720ef91c4a4b7ee83190af2accb08a10/src/view/container.tsx#L89

The use of static IDs can result in duplicate IDs if the Container component is used multiple times on the same page (this is happening in one of my projects). This situation violates the accessibility guideline SIA-R3, which recommends that element IDs should be unique.

To address this concern, I suggest making the ID dynamic or generating it dynamically to ensure uniqueness. One approach is to append a unique identifier based on some context or a counter.

If you have any questions or need further clarification, feel free to reach out. Thank you.

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.