betaWeb / inputTags-jQuery-plugin

http://betaweb.github.io/inputTags-jQuery-plugin/
40 stars 19 forks source link

Multiple Culture Support #17

Closed LazZiya closed 2 years ago

LazZiya commented 2 years ago

Hi,

Thanks for the nice library, there is an issue with cultures like "Arabic" where the key code 188 is not "comma", but any other letter in the relevant alphabet.

E.g.: in Arabic the letter "و" has the same key code 188, so if I would type any word that containes this letter it is being splitted!

I modified the code to use e.key instead of e.keyCode, so I can read the actual key as we read it:

https://github.com/betaWeb/inputTags-jQuery-plugin/blob/552f87cb46578e6be8e6da64fd7a0671cecba7e8/js/inputTags.jquery.js#L223

Also replaced key codes with actual keys self.keys = [",", "Escape"]: https://github.com/betaWeb/inputTags-jQuery-plugin/blob/552f87cb46578e6be8e6da64fd7a0671cecba7e8/js/inputTags.jquery.js#L135

This temporary solution solved my issue.

Best, Ziya

betaWeb commented 2 years ago

Hi @LazZiya,

Thanks for the report.

You can submit a PR if you want to :)

Otherwise I'll fix it later (as soon as I can).

LazZiya commented 2 years ago

I will try to submit a PR asap :)

betaWeb commented 2 years ago

Ok great. I've planned a code refactoring ASAP too, but you can submit your PR anyway :)