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

Nested ExpandablePanels Misbehaving #15

Closed
LuckierDodge opened this issue Jul 26, 2019 · 3 comments
Closed

Nested ExpandablePanels Misbehaving #15

LuckierDodge opened this issue Jul 26, 2019 · 3 comments

Comments

@LuckierDodge
Copy link

Tried to nest multiple ExpandablePanels inside each other today, and discovered a bit of a hiccup: if you expand the root panel, all of its children are expanded as well. Likewise, if you collapse any of the child panels, the whole tree collapses.

Is this something I could circumvent with a custom Expandable Widget?

@aryzhov
Copy link
Owner

aryzhov commented Jul 29, 2019

In this case, you don't need a custom Expandable. What you need is to wrap your nested ExpandablePanel with ExpandableNotifier. What's happening is ExpandablePanel creates an ExpandableNotifier, which contains the expanded state, only if it's not present in the context. So the inner ExpandablePanel finds the ExpandableNotifier of the outer ExpandablePanel. Wrapping it with an ExpandableNotifier would make it have own, independent state.

@LuckierDodge
Copy link
Author

Worked like a charm, and with a solid explanation to boot. Thank you sir!

@aryzhov
Copy link
Owner

aryzhov commented Jul 30, 2019

Glad I could help!

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