docs(TreeView): add example with unique icon per item#11377
docs(TreeView): add example with unique icon per item#11377wise-king-sullyman merged 2 commits intopatternfly:mainfrom
Conversation
|
Preview: https://patternfly-react-pr-11377.surge.sh A11y report: https://patternfly-react-pr-11377-a11y.surge.sh |
| name: 'Github accounts', | ||
| id: 'iconPerItem-Github', | ||
| icon: <GithubIcon />, | ||
| expandedIcon: <GithubIcon />, |
There was a problem hiding this comment.
Since these icons are the same, we could omit the expandedIcon prop and the default icon will be retained. Having this in the example may lead consumers to think that you have to pass both props even if the icon doesn't change.
There was a problem hiding this comment.
Good point! I initially thought it might be a good idea to show customers that "hey, you can also customize the expanded icon prop if you want". But you are right that it is rather misleading.
There was a problem hiding this comment.
Ah yeah that might be good, possibly one of the parent items retains that folder icon from the previous example to show the default and expanded icon. If you would want to do something like that that'd be good to me, but as-is this looks good
* docs(TreeView): add example with unique icon per item * docs(TreeView): don't use expandedIcon prop
Closes #10236