react-mentions
react-mentions copied to clipboard
space key doesn't working well in Google Chrome via Japanese IME
Image:
enviroments:
- Google Chrome ver 65.0.3325.181
- Google 日本語入力(Japanese) ver 2.20.2700.1
Working well on other browsers(IE, FireFox...) and languages (Chinese ...) .
Steps to reproduce:
- Input two or more syllable words
- Press the space bar
This is probably the same problem as #234
I'm having the same issue but with Korean, but only on IE Edge. If you make heads or tails on this let me know.
https://codesandbox.io/s/x2x62loryo
When inputting Japanese continuously https://github.com/signavio/react-mentions/blob/master/src/MentionsInput.js#L314
## before
let newValue = applyChangeToValue(
value,
markup,
newPlainTextValue,
this.state.selectionStart,
this.state.selectionEnd,
ev.target.selectionEnd,
displayTransform,
regex
)
after
let newValue = newPlainTextValue === '@' ?
applyChangeToValue(
value,
markup,
newPlainTextValue,
this.state.selectionStart,
this.state.selectionEnd,
ev.target.selectionEnd,
displayTransform,
regex
) : newPlainTextValue
Checking newPlainTextValue makes a good result
any idea can solve this issue in the latest version?
I wanted to raise that this problem still exists as a couple of our users have reported this issue. We're using version 4.3.0
- is there any update on if a fix is being worked on?
I've confirmed that https://github.com/signavio/react-mentions/pull/499 fixes this problem. I think the core problem is the cursor jumping by IME composition process.
First, the cursor is positioned after the sentence.(|
shows the cursor position)
これはてすとです|
With pressing the space key to start composition process, the cursor moves to just after the first word to composite.
コレは|てすとです
This cursor jumping causes something wrong with the auto-correction handling logic, and duplicates the input text. https://github.com/signavio/react-mentions/blob/79b2c44b4430a76ec8bb16fc94ffc23ae58b9f7c/src/utils/applyChangeToValue.js#L59
Any plan to review & merge the PR?