Skip to content

Allow setting isActive on a Panel in an uncontrolled Collapse  #93

Open

Description

@thomasmery

Hi there,

thanks for this component, it really helps a lot

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

Activity

  1. isuke01 commented on May 17, 2019

    @isuke01

    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 :)

  2. fartinmartin commented on Apr 8, 2020

    @fartinmartin

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions