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][base] TabList should only process children with role tab #33663

Closed
2 tasks done
siriwatknp opened this issue Jul 27, 2022 · 2 comments · Fixed by #36400
Closed
2 tasks done

[Tabs][base] TabList should only process children with role tab #33663

siriwatknp opened this issue Jul 27, 2022 · 2 comments · Fixed by #36400
Assignees
Labels
component: tabs This is the name of the generic UI component, not the React module! new feature New feature or request package: base-ui Specific to @mui/base

Comments

@siriwatknp
Copy link
Member

siriwatknp commented Jul 27, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

I want to leverage the divider in Joy but doing this does not work:

<TabList>
  <Tab>...</Tab>
  <ListDivider role="none" />
  <Tab>...</Tab>
  <ListDivider role="none" />
  <Tab>...</Tab>
</TabList>

Then I found out that TabList process the children and attach some values to them.

Does it make sense to only process the children with role="tab"? It would make it easy for customization and extension.

Or we can flip it the other way around. Ignore the child that has role="none".

Examples 🌈

No response

Motivation 🔦

No response

@siriwatknp siriwatknp added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 27, 2022
@siriwatknp siriwatknp added new feature New feature or request component: tabs This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 27, 2022
@michaldudak
Copy link
Member

Thanks for the feedback. I think we could make it work similarly to how SelectUnstyled or MenuUnstyled work with their children - not updating them directly but providing a context which they can interpret on their own.

@michaldudak
Copy link
Member

This will be fixed by #36400. The method of determining tabs was changed in that PR. The TabList won't traverse its children, but the inner Tabs will register themselves with the TabList. This will allow the TabList to host other types of children components as well.

@michaldudak michaldudak changed the title [Base] TabList should only process children with role tab [Tabs][base] TabList should only process children with role tab Mar 11, 2023
@github-project-automation github-project-automation bot moved this from To do 📃 to Done 🎉 in Base UI Alpha Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabs This is the name of the generic UI component, not the React module! new feature New feature or request package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants