Is it possible to search inside a lightning-tree component and the tree shows only the searched item and it's hierarchy?

This is how the tree is generated:

fetchRolesCollapsed() {
        var action = getTreeJSONCollapsed
        action().then((ret) => {
            let items = JSON.parse(ret)
            this.items = items
            // expand the first branch
            this.items[0].expanded = true

The lightning-tree:

<lightning-tree items={items} onselect={handleSelectAssign}></lightning-tree>


  • 2
    It's not built in, but you could write such logic if you wanted to.
    – sfdcfox
    Jan 6 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.