React-native-collapsible: How to make collapse multiple ? herein example only single collapse

Created on 9 Apr 2018  路  11Comments  路  Source: oblador/react-native-collapsible

enhancement fixed-next-release

Most helpful comment

Alright then, I suppose so! I'll add it for the next release.

All 11 comments

Could you be a bit clearer in your question?

Pretty sure @mthohir is asking how to make more than one Accordion content row expanded at a time, because I'm looking to do the same thing.

Given the API has properties like activeSection but not activeSections it does not look like react-native-collapsible is designed for this, but any advice if we were to try to hack in the capability locally?

Answering my own question: I poked at the code and hammered something out that works for me: https://github.com/oblador/react-native-collapsible/compare/master...jdonald:multi-collapse-expand?expand=1

Would it be okay to remove (replace) the activeSection property?

Is there any reason you didn't use the Collapsible by itself then if you don't need the behavior of an Accordion? An Accordion is a specific behavior https://en.wikipedia.org/wiki/Accordion_(GUI).

If you want to have multiple sections open, then recommend you use collapsible, and loop over your items. That way you can have multiple sections open since you manage your own state.

We could implement this from the ground up via Collapsible but I think that's basically reimplementing Accordion. It has its handy properties as well as functionality such as distinct renderHeader and renderContent functions.

The second sentence on that Wikipedia link says:

There can be zero expanded items, exactly one, or more than one item expanded at a time, depending on the configuration.

which suggests this particular feature request by @mthohir and myself is a reasonable enhancement to Accordion.

Alright then, I suppose so! I'll add it for the next release.

@iRoachie Can you please add this feature ASAP, it's very much required.

I鈥檒l try to look over the PR tonight

Is this feature implemented now? Will be great to have some boolean flag for this.

Just released in 1.0.0. Be sure to check section on breaking changes. Thanks for being patient!

Updated my last comment! I had released it as 0.14.0 but was told that breaks semantic versioning. So I removed 0.14.0 and published it as 1.0.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SaberRiryi picture SaberRiryi  路  3Comments

ishaqashraf picture ishaqashraf  路  6Comments

ProfessionalAmateur picture ProfessionalAmateur  路  7Comments

abdulkhaliquem9 picture abdulkhaliquem9  路  5Comments

jiyarong picture jiyarong  路  8Comments