sp-dev-fx-controls-react icon indicating copy to clipboard operation
sp-dev-fx-controls-react copied to clipboard

Treeview control, default selected key focus

Open harshdamaniahd opened this issue 1 year ago • 2 comments

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 ?

harshdamaniahd avatar Feb 01 '24 08:02 harshdamaniahd

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Feb 01 '24 08:02 ghost

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?

michaelmaillot avatar Aug 12 '24 09:08 michaelmaillot