From 5566fb7712a916356e07fcec6bfb66a843a0e91a Mon Sep 17 00:00:00 2001 From: Ivan Date: Fri, 9 Feb 2018 15:50:50 +0300 Subject: [PATCH] unavailability of first option selection in case of dynamic empty value --- dist/jquery.formstyler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 +}));