vue-jstree icon indicating copy to clipboard operation
vue-jstree copied to clipboard

when multiple set false,can not unselect

Open lerit opened this issue 6 years ago • 2 comments

if set multiple=true,it allow to unselect all node, but when set multiple=false,if i select a node ,i can not unselect it i think it reasonable that user want to cancel it if select by mistake. thanks!

lerit avatar May 21 '18 01:05 lerit

I had to edit handleSingleSelectItems method from tree.vue and compare the item id that I had to supply for each item like this:

handleSingleSelectItems(oriNode, oriItem) {
                this.handleRecursionNodeChilds(this, node => {
                    if (node.model) {
                         // set to false all the items but the one I'm selecting
                        if(node.model.id !== oriNode.model.id) {
                            node.model.selected = false
                        } else {
                            // toggle the item I selected
                            node.model.selected = oriNode.model.selected
                        }
                    }
                })
            }

albertpb avatar Oct 12 '18 21:10 albertpb

i have the same problem, but this fix no take effect

mariomartinezsoto avatar Mar 26 '20 04:03 mariomartinezsoto