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 IDs when using multiple tabs instances #947

Open
liamjohnston opened this issue Jul 25, 2022 · 4 comments
Open

Duplicate IDs when using multiple tabs instances #947

liamjohnston opened this issue Jul 25, 2022 · 4 comments

Comments

@liamjohnston
Copy link

liamjohnston commented Jul 25, 2022

🐛 Bug report

Current Behavior

When adding more than one instance of @reach/tabs to a page, each instances has clashing IDs. See screenshot:

Screen Shot 2022-07-25 at 3 29 08 PM

Expected behavior

When more than one tabs component is used on a page, all IDs should be unique. For accessibility, and for validity.

Suggested solution(s)

Either @reach/tabs should (somehow magically 🤷?) make sure to use unique IDs when mounting another component, or it should let me override the id on the <Tab> myself. I tried the latter, but it gets ignored and replaced with the default tabs--panel--[x].

Your environment

This is a react component in a non-react (static html CMS) site. The CMS user can add as many of these tabs components as needed.

Reach Package: @reach/tabs 0.17.0
React: 18.2.0
Browser: Chrome 103.0.5060.114
Node: 16
npm/yarn: yarn 1.22.19
Operating System: OSX 12.4

@ABStein
Copy link

ABStein commented Nov 8, 2022

Currently Experiencing the same issue

@ldmcdaniel
Copy link

I am having the same issue. I figured others would be experiencing the same thing.

@binhphan009
Copy link

I am having the same issue right now.

@binhphan009
Copy link

Does anyone have a workaround? Thanks in advance

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

4 participants