Closed qarlosalberto closed 9 months ago
My idea is to deselect all when the user click outside the tree.
Currently, only can be resolved by a workaround. Let's take this example and let's assume the selected item is the "vscode-tree.test.ts": https://vscode-elements.github.io/components/tree/#custom-icons
const tree = document.querySelector('#custom-icons-example');
tree.data[0].subItems[2].selected = false;
tree.requestUpdate();
You have to find the selected element in the tree data somehow. The payload of the vsc-tree-select
event contains the selected menu item data, and every menu item has a path
property. In the above example the path is 0/2
.
I found that the Tree component has a private _getItemByPath
method. I can expose that and/or add a deselectAll
public method.
that would be great!!
El dom., 11 feb. 2024 14:48, Adam Bender @.***> escribió:
I found that the Tree component has a private _getItemByPath method. I can expose that and/or add a deselectAll public method.
— Reply to this email directly, view it on GitHub https://github.com/vscode-elements/elements/issues/132#issuecomment-1937759762, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNN4R24LU2YH46VKCRS2OLYTDDZTAVCNFSM6AAAAABDDCFDZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXG42TSNZWGI . You are receiving this because you authored the thread.Message ID: @.***>
New version has been released.
thank you very much!
Is it possible to unselect a tree item?