Skip to content

Commit

Permalink
#5231 #5809 Recursion in remote search when results are success but r…
Browse files Browse the repository at this point in the history
…eturn no results on show
  • Loading branch information
jlukic committed Jun 18, 2018
1 parent 834d65d commit b4edc1b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,19 @@ $.fn.dropdown = function(parameters) {
callback();
},
onSuccess : function(response) {
module.remove.message();
module.setup.menu({
values: response[fields.remoteValues]
});
var
values = response[fields.remoteValues],
hasRemoteValues = ($.isArray(values) && values.length > 0)
;
if(hasRemoteValues) {
module.remove.message();
module.setup.menu({
values: response[fields.remoteValues]
});
}
else {
module.add.message(message.noResults);
}
callback();
}
}
Expand Down

0 comments on commit b4edc1b

Please sign in to comment.