Explorar el Código

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

Kevin Chung hace 12 años
padre
commit
770924ca8d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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"; },