sap.m.tree - getSelectedItems() do not return unfolded selected items
OpenUI5 version: 1.64
Browser/version (+device/version): Chrome
Steps to reproduce the problem:
- In a Tree, select a child node then fold and select a parent node.

What is the expected result? "getSelectedItems()" method returns 2 items.
What happens instead?
"getSelectedItems()" method returns only 1 item.

Any other information? (
If we unfold, the "getSelectedItems()" returns 2 items.

Hi, I will ask the responsible team/colleagues to get back to you on this.
Thanks
hello @Munatas,
thanks for your report. The getSelectedItems() currently only returns the visible items.
The Tree control is based on the treebinding, which currently only support the visible items count.
If there is any updated plan for this control, we will come back to you.
Best, Wenqian
I've created an internal incident 2380070422. The status of the issue will be updated here in GitHub.
Hi, the answer was given already above. The selection APIs of the Tree only consider the visible items as of now - the indices but also the item instances. Both ways are not ideal to express selections of items which are currently not available. I think for such a purpose a complete new selection API (e.g. key based) would be necessary. The Tree control is currently not in scope of our internal plans or roadmap. So I do not expect enhancements here in the upcoming future. Therefore I close this requirement for now.