diff --git a/dist/jquery.formstyler.js b/dist/jquery.formstyler.js index e6b0c07..4103650 100644 --- a/dist/jquery.formstyler.js +++ b/dist/jquery.formstyler.js @@ -586,7 +586,7 @@ var searchHeight = search.parent().outerHeight(true) || 0; var isMaxHeight = ul.css('max-height'); var liSelected = li.filter('.selected'); - if (liSelected.length < 1) li.first().addClass('selected sel'); + if (liSelected.length < 1 && optionSelected.length !== 0) li.first().addClass('selected sel'); if (li.data('li-height') === undefined) { var liOuterHeight = li.outerHeight(); if (selectPlaceholder !== false) liOuterHeight = li.eq(1).outerHeight(); @@ -1105,4 +1105,4 @@ } onDocumentClick.registered = false; -})); \ No newline at end of file +}));