Explorar o código

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

Kevin Chung %!s(int64=12) %!d(string=hai) anos
pai
achega
770924ca8d
Modificáronse 1 ficheiros con 1 adicións e 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"; },