question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Collapse widget - default "open all"

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

Collapse widget currently allows only one item to be default open. This means most of the content is hidden on load. Widget should have a default setting to load with all open.

What does the proposed API look like?

<Collapse defaultOpenAll={true} onChange={callback}>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
orianmarxcommented, Oct 25, 2019

Although you can set defaultActiveKey to an array of keys, it seems this can only be used to initialize a Collapse component. If you want to create say an expand all / collapse all button functionality, you can set a dynamic react key like this to get the component to rerender whenever you change the array of expanded keys: <Collapse defaultActiveKey={expandedKeys} key={expandedKeys.join()}>

0reactions
zhuangyacommented, Sep 21, 2020

key={expandedKeys.join()}

why do i have to write this key prop on <Collapse />? this is strange and nonintuitive

Read more comments on GitHub >

github_iconTop Results From Across the Web

Collapse - Bootstrap
If you've set the collapsible element to be open by default using the show class, set aria-expanded="true" on the control instead.
Read more >
Table widget - set default view to collapse groups
We would love to be able to set the default view for the table widget to show all boards/groups collapsed. The current setup...
Read more >
Accordion – First/All Items Collapsed | WordPress.org
Is there any way to start with all accordion items collapsed? By default with Style 1 the first box is automatically open. I...
Read more >
Solved: Expand Widget open by default? - Esri Community
Solved: In JS 4.5, is it possible to have the Expand Widget open by default? Scott.
Read more >
How to set all boxes collapsed in adminlte? - Stack Overflow
Try boxWidget('collapse') $('.box').boxWidget({ animationSpeed: 500, collapseTrigger: '#my-collapse-button-trigger', ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found