mdbootstrap / bootstrap-templates

A collection of free Bootstrap 5 templates.
https://mdbootstrap.com/freebies/
3.07k stars 1.02k forks source link

Inserting a comma in the middle of a new tag #384

Closed Liongold closed 8 years ago

Liongold commented 9 years ago

If for any reason, while writing the tag, I decide to split it by two by adding , in the middle of the tag, the comma is ignored and the tag is submitted as the whole word. Example: If I type newword and then try putting a , in the middle of the word (after new - like new,word), the tag is submitted but as new word and not new and word. Is this intended by design or a bug, please?

lucknerjb commented 9 years ago

Technically, yes, this is the expected behaviour. The comma is a delimiter but in the sense that it acts the same way as the Enter key does on a form: it submits the content of the field. This could be changed but I don't really see many real-world scenarios where someone would insert a comma in the middle of an entry to split it in two.

Liongold commented 9 years ago

@lucknerjb Should I close this then? The scenario is if someone forgets to write the , before and returns to the place where he wants the new tag to start and puts it there.

yingliangzhang commented 9 years ago

Hi @lucknerjb , I've got an exact scenario regarding this issue. What I'm doing is to use tagsinput together with an address autocomplete plugin (https://github.com/sgruhier/typeahead-addresspicker). So the addresses returned are delimitered using "," as "city, state, country" and when I select it into the input, they becomes separate tags. Could you give me some suggestions how to avoid this? It'd be cool to have customised delimiter.

lucknerjb commented 8 years ago

@Liongold Sorry for the late reply - closing it at the time would have been the next step :p

@yingliangzhang Sorry as well for the late response. Adding customized delimiters will be available with the next release. Issue being addressed is #397