-
Notifications
You must be signed in to change notification settings - Fork 355
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
feat(TreeView): onCollapse callback #9480
Conversation
Preview: https://patternfly-react-pr-9480.surge.sh A11y report: https://patternfly-react-pr-9480-a11y.surge.sh |
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. |
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
onCollapse
callback toTreeView
. This callback is triggered when a node that has children is clicked.Does
onCollapse
make the most sense for the name, or wouldonToggle
be a better fit?