sl-select with html labels #405
Replies: 2 comments 3 replies
-
It's designed to generate a plain text label from the menu item. This is an interesting idea, but if we rendered the same HTML as what's in the menu item then there's no guarantee how it would look in the control. For example, if you had styles targeting I might consider a function prop that lets you specify the text/HTML you want to render when an item is selected, but that's a bit lower level than I was planning for this component. |
Beta Was this translation helpful? Give feedback.
-
Hello @claviska :) is there anything new about that feature request? We are currently manipulating the label of the sl-select in the shadowroot to add the missing image tag in the label. This is causing weird internal javascript errors in some cases (in the shoelace chunks) Here is the code of a workaround function to force shoelace to render image tags in sl-select labels.
This is one of the most important features that we need in several projects. Are you planning to add it natively in the future? Thank you :) Greetings Daniel |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm currently working on a color select dropdown with sl-select.
Here is the code
When i choose an entry from the select, it only show's it's label:
Is it possible to also set the full html code from sl-menu-item as a label with an easy way?
It should look like this:
Thanks for your help :)
Beta Was this translation helpful? Give feedback.
All reactions