JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › ComboBox › "tokenClick" and styled elements › Reply To: "tokenClick" and styled elements
Hi edwardsmarkf,
you shouldn’t be adding HTML into the dataSource
array because it is parsed as string and will become the actual item label and value. In your case the item will be labeled ‘<span>Affogato</span>’ in the change
event and other places as well. If you need to change the HTML of a dataSource
item, there is a itemTemplate
property that accepts HTMLTemplate element. Here’s a demo. If you need to change the HTML of a token item, there’s a tokenTemplate
property that also accepts HTMLTemplate element. Here’s a demo. If you need to style a token then you should use CSS instead.
However we consider this as an issue and it will be fixed in our next release. Smart.ComboBox tokens can be styled via the following CSS selector:
.smart-combo-box .smart-token {
font-weight: 600;
}
or if you need only the label of the token, then:
.smart-combo-box .smart-token .smart-drop-down-list-selection-label {
font-weight: 600;
}
Best Regards,
Christopher
Smart HTML Elements Team
https://www.htmlelements.com