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
The TreeView exposes a
selectionproperty 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
activeSelectionoractiveItem, 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