vue-jstree
vue-jstree copied to clipboard
when multiple set false,can not unselect
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!
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
}
}
})
}
i have the same problem, but this fix no take effect