Prevent animation of a collapsible in force-mounted tab content #6978
Unanswered
WillemSleegers
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I have an issue that I hope someone can help me with. I have a simple app that has a tabs component and the content of each tab has collapsibles that animate. I want the content of each tab to be persistent so that when you switch between tabs, the inputs and stuff stay the same. I have figured out how to do that using forceMount but now the issue is that the animation of the collapsible is always triggered when the user goes to a tab with an open collapsible.
I made a simple app to demonstrate it here: https://shadcn-persistent-tabs.vercel.app
Code here: https://github.com/WillemSleegers/shadcn-persistent-tabs
You can see that if you toggle the content in the third tab, move to another tab and back, the collapsible again animates going from closed to open.
Is there a simple way to prevent this from happening?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions