Преглед на файлове

adding trim to opts.createSearchChoice default function to avoid mismatches with val object

Tim Atkinson преди 12 години
родител
ревизия
a469143f01
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -960,7 +960,7 @@ the specific language governing permissions and limitations under the Apache Lic
                     } else if ("tags" in opts) {
                         opts.query = tags(opts.tags);
                         if (opts.createSearchChoice === undefined) {
-                            opts.createSearchChoice = function (term) { return {id: term, text: term}; };
+                            opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
                         }
                         if (opts.initSelection === undefined) {
                             opts.initSelection = function (element, callback) {