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

Tabs should warn when different ids are used in Tabs.Item and Tabs.Panel #2298

Open
NicholasBoll opened this issue Jul 19, 2023 · 0 comments

Comments

@NicholasBoll
Copy link
Member

💡 Suggestion

If the developer uses a different id scheme for Tabs.Item and Tabs.Panel, the two will not be connected and it isn't always obvious why. It could be a typo. Since there may be a valid reason for a developer to use a different data-id, it should be a dev-only warning with a helpful suggestion.

Motivation

I think it would waste less time overall if the system could give useful and contextual information. Both less time wasted by product developers and less time spent by maintainers.

Example

<Tabs>
  <Tabs.List>
    <Tabs.Item data-id="one">One</Tabs.Item>
  </Tabs.List>
  <Tabs.Panel data-id="none">Ooops</Tabs.Item>
</Tabs>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant