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:
- Created 4 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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()}>
why do i have to write this
key
prop on<Collapse />
? this is strange and nonintuitive