Attach "value" object to an <sl-tree-item> #2394
jamesarosen
started this conversation in
Ideas
Replies: 0 comments
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
I'm building a tree selector out of a tree of rich JavaScript objects. The component that renders the tree and its tree-items is not necessarily the one that receives the
sl-selection-change
event. It would be nice for the receiver to get the associated object(s). Because these are rich objects, converting to and from strings for use with adata-
property is inefficient.For now, I've done this by attaching it to the element and reading it off with explicit casting:
and
Does anyone have another idea? Is this a concept that's worth adding to the library?
Beta Was this translation helpful? Give feedback.
All reactions