Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eamodio opened this issue Aug 6, 2022 · 1 comment
Assignees
Labels
feature-request Request for new features or functionality tree-views Extension tree view issues
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Aug 6, 2022

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

@alexr00 alexr00 assigned alexr00 and unassigned rebornix Aug 8, 2022
@alexr00 alexr00 added feature-request Request for new features or functionality tree-views Extension tree view issues and removed triage-needed labels Aug 8, 2022
@alexr00 alexr00 added this to the On Deck milestone Aug 8, 2022
@boltex
Copy link

boltex commented Jan 3, 2023

I thought i'd ask about this terminology aspect: How do you call the outlined cursor in a treeview ? the selection? the active element? the cursor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests

5 participants