Pārlūkot izejas kodu

Update select2.js

bugfix: .select2("data", null) for remote datasource causes an error "ReferenceError: e is not defined"
sjschukin 12 gadi atpakaļ
vecāks
revīzija
1cff8d4d22
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -2701,7 +2701,7 @@ the specific language governing permissions and limitations under the Apache Lic
         minimumInputLength: 0,
         maximumInputLength: null,
         maximumSelectionSize: 0,
-        id: function (e) { return e.id; },
+        id: function (e) { return e == undefined ? null : e.id; },
         matcher: function(term, text) {
             return (''+text).toUpperCase().indexOf((''+term).toUpperCase()) >= 0;
         },