riophae / vue-treeselect

A multi-select component with nested options support for Vue.js
https://vue-treeselect.js.org/
MIT License
2.89k stars 508 forks source link

Issue with combination of allow-clearing-disabled, allow-selecting-disabled-descendants with non-flat treeselect #139

Open kishankarun opened 6 years ago

kishankarun commented 6 years ago

Hi @riophae ,

I have a problem with the combination of below

:flat="false"
 :allow-clearing-disabled="true" 
 :allow-selecting-disabled-descendants="true"

https://codepen.io/kishanka/pen/YjOgQx

Please select a parent node and notice the difference in behaviour on 1st click, 2nd click and 3rd click and 4th click of the parent node (especially the one with disabled descendants)

riophae commented 6 years ago

Hi @kishankarun, thanks for feedback. But I'd argue that... You're not supposed to use it like that :]

kishankarun commented 6 years ago

Hi @riophae ,

Thanks for your response.

When I have flat = true, the inherent property of treeselect is that, in the selected list, i have the node, its children (and its grandchildren). But from a UI perspective as I have a big list of children (and grandchildren) my treeselect grows and looks ugly.

That's why would like to keep it flat = false so that the UI looks neat. :)

If you are suggesting me to use flat = true, along with :allow-clearing-disabled="true" :allow-selecting-disabled-descendants="true" could you please suggest me a way to display only the parent node if all its children and grandchildren are selected?

Thanks in advance.

riophae commented 6 years ago

I see. For flat = true, there should be an option specifying which options to be shown in the control. :)

kishankarun commented 6 years ago

@riophae , would you be implementing this feature :) ?

riophae commented 6 years ago

@kishankarun I'm not available at the moment. If you are interested, PRs are welcome :)