feat(TreeView): onCollapse callback#9480
Merged
tlabaj merged 3 commits intopatternfly:mainfrom Aug 16, 2023
Merged
Conversation
Collaborator
|
Preview: https://patternfly-react-pr-9480.surge.sh A11y report: https://patternfly-react-pr-9480-a11y.surge.sh |
Contributor
thatblindgeye
left a comment
There was a problem hiding this comment.
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.
Contributor
Author
|
Opted to divide the callbacks into onExpand and onCollapse because the opened state of the folder is internal. |
thatblindgeye
approved these changes
Aug 15, 2023
tlabaj
reviewed
Aug 16, 2023
Contributor
Author
|
@tlabaj Just Will add some tests. |
nicolethoen
pushed a commit
to Kells512/patternfly-react
that referenced
this pull request
Sep 1, 2023
* feat(TreeView): onCollapse callback * separate callbacks into collapse and expand * add test
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?