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

Add controlled collapsible component #83

Merged
merged 5 commits into from
Feb 29, 2024
Merged

Conversation

yigiterdev
Copy link
Contributor

Currently, the open prop in the Collapsible component does not work due to its expanded state. I thought about refactoring the component for this, but this might require refactoring on the wallet-webapp side. I added the ControlledCollapsible component instead. We need this on the builder side because we want to be able to close and open the component from outside, other than clicking. @corbanbrook

@corbanbrook
Copy link
Collaborator

Generally i think its bad to mix controlled and uncontrolled values, but after thinking about this a bit more, the collapsible really just has a single property we need to control, the open boolean. It might makes things a lot simpler to just make the Collapsible component work in both ways.

@corbanbrook
Copy link
Collaborator

Oh... and i don't think this would introduce any breaking changes.

Simply we should check if the passed in open property was present, ie. not undefined, and then use the controlled value or use state value.

What do you think?

@yigiterdev
Copy link
Contributor Author

Yeah makes sense. I fixed it as you suggested. I hope I understood correctly, it should work better this way. @corbanbrook

@corbanbrook corbanbrook merged commit f98fe4c into master Feb 29, 2024
1 check passed
@corbanbrook corbanbrook deleted the add-controlled-collapsible branch February 29, 2024 18:35
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

Successfully merging this pull request may close these issues.

2 participants