Skip to content

Commit 37073f6

Browse files
committed
Merge pull request select2#1485 from timisbusy/master
Trimming in opts.createSearchChoice
2 parents 42d3ef4 + a469143 commit 37073f6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

select2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ the specific language governing permissions and limitations under the Apache Lic
955955
} else if ("tags" in opts) {
956956
opts.query = tags(opts.tags);
957957
if (opts.createSearchChoice === undefined) {
958-
opts.createSearchChoice = function (term) { return {id: term, text: term}; };
958+
opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
959959
}
960960
if (opts.initSelection === undefined) {
961961
opts.initSelection = function (element, callback) {

0 commit comments

Comments
 (0)