Choices-js / Choices

A vanilla JS customisable select box/text input plugin ⚡️
https://choices-js.github.io/Choices/
MIT License
6.06k stars 597 forks source link

Wrong character when using non-English (Farsi) keyboard #1068

Open ousmorez opened 1 year ago

ousmorez commented 1 year ago

Describe the bug When we try to enter a non-English word for example Persian (Farsi), this happens: While the keyboard is set on Farsi language, open a select box and then select one of the options. Then at that moment try to write something, as you see in the GIF below, the first letter is English and then the second letter and the rest of them is Persian (Farsi). choicejs-bug

Also, if you try to enter a number (numbers in the image below), the first character will be an English letter, then the second character and the rest will be numbers.

71Va9DgRgwL _SL1500_

To Reproduce

  1. Set your keyboard on Persian (Farsi) See how to add languages to keyboard on windows 10/11 : https://support.microsoft.com/en-us/windows/manage-the-input-and-display-language-settings-in-windows-12a10cb4-8626-9b77-0ccb-5013e0c7c7a2#:~:text=Select%20the%20Start%20button%2C%20then,keyboard%20you%20want%20to%20add. Steps to reproduce the behavior:
  2. Go to Choicejs
  3. Click on 'Right-to-left'
  4. Select 'Choice1'
  5. Type something
  6. First letter is English and the rest of the letters is Persian (Farsi)

Expected behavior I expected to see only Farsi (Persian) characters on the screen.

Screenshots choicejs-bug

Desktop (please complete the following information):

I need to use Choicejs asap, if someone tell me a solution I can fix it in my project, I use it in formiojs and I can fix it externally. If I find the solution myself, I'll post a merge request here, but I need help.