[Dropdown] Add "Include HTML" option, or modify action to include 'set html'
I am using the dropdown to select an image among several options. Images show nice in the dropdown (when the menu is expanded), however when I select one option, the image is not set as the current value. I believe you are using the .text() method to set it, would it be possible to allow using images as menu options?
Thank you
I'll look into adding as a dropdown action, set html.
For now, you can use data-text="foo" to pass in an exact value.
For example
<div class="ui dropdown">
<!-- additional html not shown !-->
<div class="item" data-text="<img src='dog.jpg'> Dog">
<img src="dog.jpg"> Dog
</div>
</div>
@dragosmocrii
Added a new setting in `1.0preserveHTML which can be used to preserve HTML values instead of just text.
Keyboard navigation added with paging in 1.0
See docs for examples, particularly language select: http://beta.semantic-ui.com/modules/dropdown.html
Hello, there is a way to use preserveHTML with a dropdown generated by a select tag?
I see https://github.com/Semantic-Org/Semantic-UI/blob/master/src/definitions/modules/dropdown.js#L1562
return ($choice.data(metadata.text) !== undefined)
? $choice.data(metadata.text)
: (preserveHTML)
? $.trim($choice.html())
: $.trim($choice.text())
;
but, .html() of an <option> only returns the text without the html tags.