Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behaviour when type query in Russian #345

Closed
sergeylaptev opened this issue Jul 29, 2015 · 11 comments
Closed

Unexpected behaviour when type query in Russian #345

sergeylaptev opened this issue Jul 29, 2015 · 11 comments

Comments

@sergeylaptev
Copy link

Hello, when I type some queries in Russian and use "б" letter, input always interrupt. The root of evil at this line https://github.com/JedWatson/react-select/blob/master/src/Select.js#L427. On a russian keyboard we have "б" letter, whereas in english it's ",". We can fix this, by checking charCode instead of key number.

@bruderstein
Copy link
Collaborator

Unfortunately charCode isn't set for keyDown events, only keyPress events.
Please excuse my lack of knowledge about Russian, but I presume you do have a comma key on your keyboard (or at least, can enter one somehow), can you enter it in http://www.w3.org/2002/09/tests/keys.html and post the results here?

Keyboard events in browsers are broken, and i18n just makes it worse, so I'm not sure there's a good solution to this, but we can take a look :)

@webvit
Copy link

webvit commented Aug 11, 2015

+1

Character "б"
Keyboard Event Properties:

Data     keydown     keypress     keyup
keyCode     188     1073     188
charCode     —     1073     —

@bruderstein
Copy link
Collaborator

Thanks for posting. I meant can you post what happens when you press your "comma" key?

@webvit
Copy link

webvit commented Aug 12, 2015

"comma [б]" key works as "enter" key, adds tags in multi mode
and delimiter option does not override "comma" to another symbol

@bruderstein
Copy link
Collaborator

Yes, but I need to know what http://www.w3.org/2002/09/tests/keys.html says, when you press your comma key, not your б key, so that we can work out how we can decide what the user pressed.

б is simply being treated as comma, because it has the same keycode. On keyPress, we see the character, and I fear we may have to wait for keyPress before acting on ','. However, I'd like to see what the w3 link above says when you press your version of your comma.

Many thanks for assisting!

@webvit
Copy link

webvit commented Aug 12, 2015

I understood,

Firefox, Mac OS:

Data    keydown keypress    keyup
keyCode   188   0   188
charCode   —   44   —
Character   ,

Chrome, Mac OS:

Data    keydown keypress keyup
keyCode   188   44  188
charCode    —  44   —
Character   ,

Safari:

Data    keydown keypress    keyup
keyCode   188   44  188
charCode    —  44 —
Character   ,

@bruderstein
Copy link
Collaborator

ok, great, thanks. That was kinda what I was afraid of. I'll have a bit of a play and see if I can come up with a solution.

Cloudo pushed a commit to Cloudo/react-select that referenced this issue Feb 5, 2016
@alisag
Copy link

alisag commented Feb 26, 2017

same problem with hebrew...

@Dicondur
Copy link

Dicondur commented Oct 4, 2017

Hi were you able to find a solution to this?

@evgenymarkov
Copy link

evgenymarkov commented Oct 24, 2017

We are faced with the same problem. It works as expected only in Firefox.

@jossmac
Copy link
Collaborator

jossmac commented Mar 17, 2020

Version 1 of react-select is no longer supported.

In the best interest of the community we've decided to spend the time we have available on the latest version.

We apologise for any inconvenience.

Please see:

  1. v1 to v2 upgrade guide
  2. v1 documentation and examples

@jossmac jossmac closed this as completed Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants