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 break when there is only one tab in <Tabs.List> #1774

Closed
joeyamst opened this issue Dec 5, 2024 · 3 comments · Fixed by #1775
Closed

Tabs break when there is only one tab in <Tabs.List> #1774

joeyamst opened this issue Dec 5, 2024 · 3 comments · Fixed by #1775
Assignees
Labels
bug Something isn't working

Comments

@joeyamst
Copy link

joeyamst commented Dec 5, 2024

Describe the issue

When using the Tabs, it breaks with the error Uncaught TypeError: children[0].props.children.map is not a function in the <Tabs> component.

Summary

            <Tabs activeTab={0}>
                <Tabs.List>
                    <Tabs.Button tab={0}>Tab 1</Tabs.Button>
                    {/*<Tabs.Button tab={1}>Tab 2</Tabs.Button>*/}
                </Tabs.List>
                <Tabs.Panel tab={0}>
                    <Heading level={3}>Tab 1 Title</Heading>
                </Tabs.Panel>
            </Tabs>

This breaks with the error. Uncommenting line 4 and it works fine again and shows 2 tabs.

Environment

  • Browser: Chrome
  • Operating System: Windows with WSL
  • Version of the design system: v0.13.1

Checklist

Before submitting your issue, please ensure you have done the following:

  • [ x ] Search the issue tracker to ensure the issue has not already been reported.
  • [ x ] Verify that the issue can be consistently reproduced.
  • [ x ] Check if the issue is already documented.

Additional notes

I agree having only 1 tab is useless, but for developing sometimes you build one tab first, and add more later. Maybe tabs can also be dynamic on user input, creating a situation where it's possible to only having one tab.

@RubenSibon RubenSibon self-assigned this Dec 5, 2024
@RubenSibon RubenSibon added the bug Something isn't working label Dec 5, 2024
@RubenSibon
Copy link
Contributor

A fix for this is incoming.

@VincentSmedinga
Copy link
Contributor

This has been resolved but has yet to be published. We expect a new release to ship in the second half of January. If it would be useful to have it earlier, let us know, and we can make it a hotfix.

@VincentSmedinga
Copy link
Contributor

@joeyamst The fix has been published in release 0.14.

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

Successfully merging a pull request may close this issue.

3 participants