Semantic-ui: [Dropdown] "Choose an option", goes away after first change

Created on 25 Nov 2016  路  4Comments  路  Source: Semantic-Org/Semantic-UI

  • 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:

  • Semantic-UI 2.2.6
  • jQuery 2.2.4
Usage Question

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:

$('.ui.dropdown').dropdown('restore defaults');

I'll usually have a clear button next to my dropdown who's click handler runs the above code.

All 4 comments

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 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

mixerp picture mixerp  路  3Comments

guilhermeblanco picture guilhermeblanco  路  3Comments

ghost picture ghost  路  3Comments

iPaoo picture iPaoo  路  3Comments