-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Feature Request] Add destroyInactiveTabPanel
prop for Tabs component
#1562
Comments
@Softwaremanufaktur |
Hi, I updated NextUI to 2.4.0 but the prop is not changing anything, my tab and the component within it keep being re rendered each time we switch tabs. Any idea why it could be the case? I made sure to put the prop in Tabs as indicated above. And deleted Node_modules and reinstalled but the prop is still not working. Thanks |
@Neuro8 can u setup a minimal reproducible stackblitz project for us to investigate? UPD: i can reproduce now. will take a look. |
any update here? Setting destroyInactiveTabPanel to false does not prevent tab destruction. |
@drewdearing the fix has been deployed to 2.4.2. Are you using the latest version? |
Oh I didn't realize there was a fix based on this thread. I'll give it a try. |
Is your feature request related to a problem? Please describe.
In some cases, I hope that when switching tabs, the previous TabPanel will not be destroyed in order to preserve their state and avoid re-rendering.
Describe the solution you'd like
We can add a
destroyInactiveTabPanel
prop with a default value offalse
.The inactive TabPanel can be hidden using
display: none
.If the user wants to destroy the previous TabPanel every time they switch tabs, they can simply add it to the Tabs component.
Describe alternatives you've considered
Now can also achieve the same effect by yourself, but each time you need to write additional code or encapsulate it again.
Screenshots or Videos
No response
The text was updated successfully, but these errors were encountered: