sp-dev-fx-controls-react
sp-dev-fx-controls-react copied to clipboard
Treeview control, default selected key focus
Hi, I am using https://pnp.github.io/sp-dev-fx-controls-react/controls/TreeView/ control. I passing a key defaultSelectedKeys={this.state.defaultSelected} , this works. but doesnt focus on the item due to long list of tree strutcure. is there a way to focus on the item ?
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hi @harshdamaniahd,
Currently there's no way to focus on a specific item. But this could be possible with the addition of a new prop which will require an optional key (whether selected or not) that match one of populated ones in items
. Then we could use the React ref
attribute to set the focus during the mounting event of the TreeItem
component.
Let me add this one as an enhancement idea. Thanks for submitting it!
would you like to give a try?