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

Enable setting custom TreeItemElement component #333

Closed
cunj123 opened this issue Feb 8, 2024 · 1 comment
Closed

Enable setting custom TreeItemElement component #333

cunj123 opened this issue Feb 8, 2024 · 1 comment
Assignees

Comments

@cunj123
Copy link

cunj123 commented Feb 8, 2024

Is your feature request related to a problem? Please describe.
I am trying to add animation to the item children list when expanding/collapsing. The easiest way to do that would be to put the transition on the height property and toggle the height between some value and 0.

Currently that is not possible becuase TreeItemElement doesn't render anything if the node isn't expanded.

Describe the solution you'd like
Allow developers to define a custom TreeItemElement where the hide/show behavior can me implemented.

Describe alternatives you've considered
Make the default behavior for showing/hiding nodes the one I described, but I don't think that's a good solution.

@lukasbach
Copy link
Owner

Hi, thanks for the suggestion. It's not really feasible to make the entirety of TreeItemElement customizable, but I extracted the logic for when it does render its items and when not customizable through the shouldRenderChildren prop in v2.3.5. That should hopefully help you achieve what you want.

See Demo
and Demo Implementation for details

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