react-mentions icon indicating copy to clipboard operation
react-mentions copied to clipboard

space key doesn't working well in Google Chrome via Japanese IME

Open tomoyamachi opened this issue 6 years ago • 6 comments

Image:

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:

  1. Input two or more syllable words
  2. Press the space bar

tomoyamachi avatar Apr 04 '18 05:04 tomoyamachi

This is probably the same problem as #234

jfschwarz avatar Apr 05 '18 11:04 jfschwarz

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

justincrich avatar Jan 07 '19 23:01 justincrich

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

timeshiftseiya avatar Feb 10 '19 16:02 timeshiftseiya

any idea can solve this issue in the latest version?

wesleywong avatar Mar 26 '19 02:03 wesleywong

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?

mikellykels avatar Nov 18 '21 21:11 mikellykels

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?

mj-hd avatar Apr 14 '22 00:04 mj-hd