diff --git a/src/js/select2/results.js b/src/js/select2/results.js index 342fd947..b43d288c 100644 --- a/src/js/select2/results.js +++ b/src/js/select2/results.js @@ -48,9 +48,15 @@ define([ ) ); + $message[0].className += ' select2-results__message'; + this.$results.append($message); }; + Results.prototype.hideMessages = function () { + this.$results.find('.select2-results__message').remove(); + }; + Results.prototype.append = function (data) { this.hideLoading(); @@ -250,6 +256,7 @@ define([ }); container.on('query', function (params) { + self.hideMessages(); self.showLoading(params); });