Skip to content

TreeView.selection does not contain focused but not highlighted items #170248

@EhabY

Description

@EhabY

When looking at TreeView.selection , it seems that the tree view only keeps track of the selected items but not the focused one. For example, click on any item in the tree then using the arrow keys move up or down. The focused item has changed but there is no way to programmatically get it.

image
Here, selection ONLY contains MyFile3 and not MyFile1 even though it is focused.

This is annoying because we have a tree view of the project, where the user can delete, copy, paste etc. So it's expected that they be able to perform these actions on the focused item like in the explorer.

A bit similar to #157406 but this calls for the focused item (border but no highlight) to actually be accessible. If I had to amend the API, it would be focusedItem to separate it from selection.

Metadata

Metadata

Assignees

Labels

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