Skip to content

Commit

Permalink
fix(dropdown): Make fomantic#287 also work for div-dropdowns and prev…
Browse files Browse the repository at this point in the history
…ent console error
  • Loading branch information
lubber-de committed Dec 11, 2018
1 parent 991a195 commit 70c6006
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,11 @@ $.fn.dropdown = function(parameters) {
if(settings.filterRemoteData) {
module.filterItems(searchTerm);
}
$.each($input.val(),function(index,value){
var preSelected = $input.val();
if(!Array.isArray(preSelected)) {
preSelected = preSelected!=="" ? preSelected.split(",") : [];
}
$.each(preSelected,function(index,value){
$item.filter('[data-value="'+value+'"]')
.addClass(className.filtered)
;
Expand Down

0 comments on commit 70c6006

Please # to comment.