Select2 4.0.0: Single Select with tags=true Can't Use Space Character When Adding Tag

727 views
Skip to first unread message

Matt Eidson

unread,
Jul 8, 2015, 2:10:47 AM7/8/15
to sel...@googlegroups.com
All:

I have a select element (single) configured for select2 as follows:

$(#mySelect).select2({
      tags: true,
      tokenSeparators: [',']
});

I have tags set to 'true' to allow end-users to add their own values to the list.

Everything works fine except for values that contains spaces, the space key is not allowed even though I do not have it in the list of tokenSeparators.

Typing in single word values and hitting a comma; everything works as advertised in the documentation. But, the minute you want to use a space (e.g. New York) the space is not allowed and I don't see any errors in the debugger.

Any ideas what may happening here?

Thanks for your time.

-Matt-

Kevin Brown

unread,
Jul 13, 2015, 1:52:42 PM7/13/15
to sel...@googlegroups.com
I thought this was going to be a space-trimming issue, but after testing it out in a jsbin I cannot actually reproduce the issue.


Can you reproduce the issue in the jsbin? Does it happen on all browsers?

--
You received this message because you are subscribed to the Google Groups "select2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
To post to this group, send email to sel...@googlegroups.com.
Visit this group at http://groups.google.com/group/select2.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages