Skip to content

Commit

Permalink
fix(dropdown): corrected initial clearable icon when '<select>' is used
Browse files Browse the repository at this point in the history
When a dropdown was setup out of a select tag and had empty values set but used something different than placeholder: 'auto', the initial clearable icon was shown, although the initial value was "" (= no selection)

Closes #839
  • Loading branch information
lubber-de authored and Sean committed Jul 25, 2019
1 parent 58fdc6a commit 31d80d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2027,11 +2027,11 @@ $.fn.dropdown = function(parameters) {
? module.get.values()
: module.get.text()
;
isMultiple = (module.is.multiple() && Array.isArray(value));
shouldSearch = (isMultiple)
? (value.length > 0)
: (value !== undefined && value !== null)
;
isMultiple = (module.is.multiple() && Array.isArray(value));
strict = (value === '' || value === false || value === true)
? true
: strict || false
Expand Down Expand Up @@ -2175,7 +2175,8 @@ $.fn.dropdown = function(parameters) {
else {
module.set.selected();
}
if(module.get.item()) {
var value = module.get.value();
if(value && value !== '' && !(Array.isArray(value) && value.length === 0)) {
$input.removeClass(className.noselection);
} else {
$input.addClass(className.noselection);
Expand Down

0 comments on commit 31d80d2

Please sign in to comment.