Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any option or prop to default collapsed list #53

Open
hpvaghani opened this issue Dec 22, 2020 · 3 comments
Open

Any option or prop to default collapsed list #53

hpvaghani opened this issue Dec 22, 2020 · 3 comments

Comments

@hpvaghani
Copy link

Hi,

Is there any option or prop that can be used to default list to be collapsed on load ?

@marouanekadiri
Copy link
Owner

Could you share an example of the use case you want to achieve and which component are you using?

@hpvaghani
Copy link
Author

Hi,

<AccordionList list={this.state.list} header={this._head} body={this._body} keyExtractor={item => ${item.id}} />

I was using the above snippet in my application, where there was header(of the items in list) and body(contains detail about item). It is working fine but there was an issue where all of the items in the list were unCollapsed. User has to collapse the items manually which behavior wise was bit odd. So i was looking for prop that after setting it all the bodies of the items would be default invisible and will be visible only after clicking header(default behavior). Also i was looking for a way to override header click(a button in header to call function other than toggling body).

@marouanekadiri
Copy link
Owner

The body is by default hidden, no prop needed.
If you put a button in the header and map it to a certain behavior the Accordion should not interfere with this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants