HTML
JS
$(document).ready(function () {
$('.ui.dropdown').dropdown();
});
Problem:
At first, the Choose an option shows up, but it goes away after first change.
Environment:
This is the expected behavior. If you would like to restore the "Choose an option" option, you will need to restore the dropdown to its defaults via:
$('.ui.dropdown').dropdown('restore defaults');
I'll usually have a clear button next to my dropdown who's click handler runs the above code.
Thanks for your message buddy, but I don't think if this behaviour always is desired. Imagine an example usage in which the placeholder option is titled:
None of the below
There you should be able to simply choose that option again, even after a wrong choice or missclick.
Do this, Remove the div with dropdown class and add _ui dropdown_ class to select element.
Note : This worked for me !
Most helpful comment
This is the expected behavior. If you would like to restore the "Choose an option" option, you will need to restore the dropdown to its defaults via:
I'll usually have a clear button next to my dropdown who's click handler runs the above code.