When creating a searchable dropdown from existing HTML, the dropdown item's value property in the element data is cleared when searching and no results are available. This is because, when the "No results" message is shown, the menuObserver mutation observer is fired which calls module.refresh(), which in turn calls module.refreshData() which removes the value and text data values from the item elements.
Here is a jsbin that reproduces the issue: http://jsbin.com/runetopasi/edit?html,js,output
Here is the code that removes the value and text data from the items:
|
$item |
|
.removeData(metadata.text) |
|
.removeData(metadata.value) |
. Could you please explain the reason behind this code? Otherwise, simply removing these lines will fix this issue.
When creating a searchable dropdown from existing HTML, the dropdown item's
valueproperty in the element data is cleared when searching and no results are available. This is because, when the "No results" message is shown, themenuObservermutation observer is fired which callsmodule.refresh(), which in turn callsmodule.refreshData()which removes thevalueandtextdata values from the item elements.Here is a jsbin that reproduces the issue: http://jsbin.com/runetopasi/edit?html,js,output
Here is the code that removes the
valueandtextdata from the items:Semantic-UI/src/definitions/modules/dropdown.js
Lines 385 to 387 in 04a3c48