You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow setting isActive on a Panel in an uncontrolled Collapse #93
only thing I'm having difficulty with is being able to simply open panel programatically by passing a isActive prop to the panel without having to go the whole controlled way (with activeKey on the Collapse)
is it possible?
thanks a lot
Reacted by Pierrick Boutruche, Łukasz ISU Biedroń and Waqas
I think for now you can control it programatically by passing defaultActiveKey={['1'],['2']} to collapse element if you want to have by default open 1 and 2 would be nice if we can pass to panel just isActive as true :)
@isuke01 I'm not having much luck with defaultActiveKey={['1'],['2']}. Rather than having panel 1 and 2 open by default it seems to only evaluate the last array (['2']) and therefore only render panel 2 open. Any ideas?
Edit: I've somehow got this working in production but not in this demo 🤔
Edit: Got it to work in the demo by using an array of strings (defaultActiveKey={["1", "2"]}) instead of an array (maybe? not actually sure what this is) of arrays of strings (defaultActiveKey={['1'],['2']}). The CodeSandbox has been updated.
Activity
isuke01 commentedon May 17, 2019
I think for now you can control it programatically by passing
defaultActiveKey={['1'],['2']}to collapse element if you want to have by default open 1 and 2 would be nice if we can pass to panel just isActive as true :)fartinmartin commentedon Apr 8, 2020
@isuke01 I'm not having much luck with
defaultActiveKey={['1'],['2']}. Rather than having panel 1 and 2 open by default it seems to only evaluate the last array (['2']) and therefore only render panel 2 open. Any ideas?Edit: CodeSandbox Link
Edit: I've somehow got this working in production but not in this demo 🤔
Edit: Got it to work in the demo by using an array of strings (
defaultActiveKey={["1", "2"]}) instead of an array (maybe? not actually sure what this is) of arrays of strings (defaultActiveKey={['1'],['2']}). The CodeSandbox has been updated.