sagalbot / vue-select

Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.
https://vue-select.org
MIT License
4.65k stars 1.34k forks source link

select-on-key-codes with diffrent languages #1157

Open MosheL opened 4 years ago

MosheL commented 4 years ago

Describe the bug I am using :select-on-key-codes="[188, 13,222]" in diffrent languages we need the keycode diffrently.

To Reproduce use a keyboard

Expected behavior use the comma keyt for tags the problem is the comma is diffrent key code in Hebrew or in English. in English is 188, and in Hebrew is 222 in Hebrew, key 188 is ת, so user type the character and the tag end, and when I am using English the 222 character is '.

so we need to select the character against the language.

MosheL commented 4 years ago

UPDATE:

the solution is very simple.

On the onSearchKeyDown function you test the keyCode. You can also test the key field. the key is inserted in the real language, so for it can work in multiple languages.

so I added:

if ("function" == typeof i[t.key]) return i[t.key](t);

I also need to modify the :select-on-key-codes="[13,',']". it is working now.