Преглед изворни кода

Fix empty Select2 input from throwing an error when attempting to selecting a value.

Kevin Chung пре 12 година
родитељ
комит
770924ca8d
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -2361,7 +2361,7 @@
             return markup.join("");
         },
         formatSelection: function (data, container) {
-            return data.text;
+            return data ? data.text : undefined;
         },
         formatResultCssClass: function(data) {return undefined;},
         formatNoMatches: function () { return "No matches found"; },