Skip to content

Commit 770924c

Browse files
committed
Fix empty Select2 input from throwing an error when attempting to selecting a value.
1 parent 819cca7 commit 770924c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2361,7 +2361,7 @@
23612361
return markup.join("");
23622362
},
23632363
formatSelection: function (data, container) {
2364-
return data.text;
2364+
return data ? data.text : undefined;
23652365
},
23662366
formatResultCssClass: function(data) {return undefined;},
23672367
formatNoMatches: function () { return "No matches found"; },

0 commit comments

Comments
 (0)