Skip to content

Commit 69ef214

Browse files
committed
Display error message on AJAX errors
This display the `errorLoading` translation when there is an error during the AJAX cycle. Previously we were just throwing these errors out, now we are actually displaying an error message. This closes select2#3501
1 parent db5e947 commit 69ef214

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/js/select2/data/ajax.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ define([
8080

8181
callback(results);
8282
}, function () {
83-
// TODO: Handle AJAX errors
83+
self.trigger('results:message', {
84+
message: 'errorLoading'
85+
});
8486
});
8587

8688
self._request = $request;

0 commit comments

Comments
 (0)