sl-tree
to support unchecking child nodes without unchecking the parent node
#1630
Replies: 4 comments
-
@coderberry Please see this discussion: #1214 (reply in thread) If we could support that in |
Beta Was this translation helpful? Give feedback.
-
Also related: #1345 |
Beta Was this translation helpful? Give feedback.
-
I'd like to track all work related to the tree's selection modes here. It sounds like #1214 and #1345 might be closely related, so perhaps we can tackle all of them in one place. |
Beta Was this translation helpful? Give feedback.
-
@claviska Are there any plans to support 'any'? |
Beta Was this translation helpful? Give feedback.
-
What issue are you having?
We are needing the
sl-tree
to allow unchecking child nodes without unchecking the parent node. Our use case is that we need to allow our customers to select parent "modules" that may have content, but not include the sub-"modules". In this case, we are providing access to an online course, and we may not want to allow deeply nested course modules.Currently with the
sl-tree
component, we are unable to deselect all the child nodes without deselecting the parent node as well.Our goal:
(see discussion)
Describe the solution you'd like
I have created a fork/branch that adds an additional option to the
selection
property calledany
. This PR provides a way to allow what we are hoping to achieve.Here's a demo of the functionality added:
Here's the core change (and a full diff):
Describe alternatives you've considered
We have attempted to write this outside of shoelace, but we love shoelace and prefer to use it for as much as we can.
Beta Was this translation helpful? Give feedback.
All reactions