Skip to content

Commit b593d06

Browse files
committed
Update select2.js
Add a "Searching" label state for AJAX data
1 parent 3a1dcd1 commit b593d06

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

select2.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,9 @@
10811081
render("<li class='select2-no-results'>" + opts.formatInputTooShort(search.val(), opts.minimumInputLength) + "</li>");
10821082
return;
10831083
}
1084+
else {
1085+
render("<li class='select2-searching'>" + opts.formatSearching() + "</li>");
1086+
}
10841087

10851088
this.resultsPage = 1;
10861089
opts.query({
@@ -2193,6 +2196,7 @@
21932196
formatInputTooShort: function (input, min) { return "Please enter " + (min - input.length) + " more characters"; },
21942197
formatSelectionTooBig: function (limit) { return "You can only select " + limit + " items"; },
21952198
formatLoadMore: function (pageNumber) { return "Loading more results..."; },
2199+
formatSearch: function () { return "Searching..."; },
21962200
minimumResultsForSearch: 0,
21972201
minimumInputLength: 0,
21982202
maximumSelectionSize: 0,

0 commit comments

Comments
 (0)