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

[lab][TabPanel] Add keepMounted prop to match joy-ui #41651

Merged

Conversation

ppaskaris-plooto
Copy link
Contributor

@ppaskaris-plooto ppaskaris-plooto commented Mar 25, 2024

This PR adds a keepMounted prop to the labs implementations of TabPanel, bringing it into alignment with the implementation in joy-ui. It also adds a -hidden class, aligning it with both base-ui and joy-ui for easier styling/theming now that the children can be present in the DOM when the tabpanel is not active.

Fixes #37398
Fixes #38178

I am only addressing the immediate absence of this prop compared to joy-ui, and not trying to solve for the broader issue described in #21250.

@mui-bot
Copy link

mui-bot commented Mar 25, 2024

Netlify deploy preview

https://deploy-preview-41651--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against b469e8e

@zannager zannager added component: tabs This is the name of the generic UI component, not the React module! package: lab Specific to @mui/lab package: base-ui Specific to @mui/base labels Mar 26, 2024
@michaldudak
Copy link
Member

Base UI development was moved to a separate repository: https://github.com/mui/base-ui. We don't accept contributions in this repo anymore. As the Tabs are undergoing API change (mui/base-ui#245), we will consider adding your proposed prop.

The Lab implementation looks OK to me.

@ppaskaris-plooto
Copy link
Contributor Author

I'll revert the base-ui changes to leave only the labs proposal 👍

@ppaskaris-plooto ppaskaris-plooto force-pushed the add-keep-mounted-prop-to-labs-tabpanel branch from 9c715ec to b469e8e Compare March 27, 2024 13:33
@ppaskaris-plooto ppaskaris-plooto changed the title [base,lab][TabPanel] Add keepMounted prop to match joy-ui [lab][TabPanel] Add keepMounted prop to match joy-ui Mar 27, 2024
Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be working well. Thanks for your contribution!

As a side note, we decided to include this prop in the Base UI implementation as well.

@siriwatknp siriwatknp merged commit 49fb397 into mui:next Apr 3, 2024
22 checks passed
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! package: base-ui Specific to @mui/base package: lab Specific to @mui/lab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

restore component state in data grid when switching tabs [Tabs] Add keepMounted property
5 participants