LeoEatle / react-composition-input

The input component optimized for languages like Chinese, Japanese etc.
MIT License
83 stars 11 forks source link

Chrome 40 and Samsung pinyin keyboard causes double entry #3

Open cyph84 opened 5 years ago

cyph84 commented 5 years ago

Happens only on Samsung keyboard on a Galaxy Tab E. Google pinyin keyboard seems to be ok.

Fixed by commenting out https://github.com/LeoEatle/react-composition-input/blob/19600525099666026e939958e98e7644cbc4aaf9/src/inputfield.js#L47

Tested on Safari iOS and chrome 74 with that line commented out and seems to work. Why was there a need to set the value back into the text field.

LeoEatle commented 5 years ago

Thank you for your found. What is the meaning of double entry? Is it meaning when we select one character it show up two? If that's the case, I don't quite understand the cause of it.

But yes, you are right about this line event.target.value = userInputValue. I really don't understand why I add this 😂. Maybe for not modifying event.target.value. We can just remove it.

If you have time, you can send a PR. Or I'll fix it these days.

cyph84 commented 5 years ago

After selecting a candidate character. Two characters appear in the text field.

Here is a video: https://photos.app.goo.gl/fjThXRtNjKe71unn7