Skip to content

TreeView.selection provides all selected items, but can't tell which one is the "active" one #157406

@eamodio

Description

@eamodio

The TreeView exposes a selection property which is an array of the selected items, but there isn't a way (that I know of) to tell which one of those selected items is the active/focused one. I thought maybe it was clever and the first item in the array was always the active one, but that isn't the case (it always seems to be in top to bottom order).

With commands executed on trees with canSelectMany, you get the active/focused node, and then an array of all selected nodes.

It would be great to either have another property on TreeView like activeSelection or activeItem, or if we don't want another API, we could just make the active one always be the first item in the array.

/cc @alexr00

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)feature-requestRequest for new features or functionalitytree-viewsExtension tree view issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions