-
Notifications
You must be signed in to change notification settings - Fork 375
feat(TreeView): onCollapse callback #9480
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
Conversation
|
Preview: https://patternfly-react-pr-9480.surge.sh A11y report: https://patternfly-react-pr-9480-a11y.surge.sh |
thatblindgeye
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's being called when the tree view collapses and expands onToggle sounds like a better fit. Another option might be also adding an onExpand callback and calling it and onCollapse when applicable.
|
Opted to divide the callbacks into onExpand and onCollapse because the opened state of the folder is internal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think onCollapse make sense.
Can you add some unit test for these please?
|
@tlabaj Just Will add some tests. |
tlabaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* feat(TreeView): onCollapse callback * separate callbacks into collapse and expand * add test
What: Closes #9361
Adds
onCollapsecallback toTreeView. This callback is triggered when a node that has children is clicked.Does
onCollapsemake the most sense for the name, or wouldonTogglebe a better fit?