You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that the character next to the cursor is wrongly deleted when I input a Japanese character.
(maybe it also occurs in some other multibyte languages...?)
I looked into the code and figured out this part of the core plugin causes it.
But the fundamental problem is anchorOffset and focusOffset returned by native window.getSelection() is different in each browsers.
I tested the behavior by inputting Japanese character あ into the sentence below. (| is cursor)
A line of text in a para|graph.
The result is so strange:
Browser
anchorOffset
focusOffset
Expected
24
24
Safari (iOS/Mac)
24
24
Chrome 58 (Mac/Win)
24
25
Firefox 53 (Mac/Win)
25
25
IE 11 (Win)
25
25
I think it's hard to fix, but it's a fact that the fix only for iOS affects Japanese input unexpectedly.
So my suggestion is checking platform before updating the selection.
What's the expected behavior?
I can submit PR if my suggestion is accepted.
The text was updated successfully, but these errors were encountered:
Hey @questbeat, thanks for investigating this. I honestly don't know enough about how other language character input works to be able to debug well. I tried making it work in the past but I'm sure it's regressed since then. I'd love PR's that help fix it—as long as they don't break the existing behaviors. Thank you!
Hi @questbeat, could you add [IME] to the title of this issue? It makes it easier to round up bugs related to IMEs by a simple search. I want to help get to the bottom of the problem, and this would help a lot!
nek023
changed the title
Wrong character deletion after inputting Japanese character
[IME] Wrong character deletion after inputting Japanese character
Aug 20, 2017
Do you want to request a feature or report a bug?
bug
What's the current behavior?
I found that the character next to the cursor is wrongly deleted when I input a Japanese character.
(maybe it also occurs in some other multibyte languages...?)
I looked into the code and figured out this part of the core plugin causes it.
But the fundamental problem is
anchorOffset
andfocusOffset
returned by nativewindow.getSelection()
is different in each browsers.I tested the behavior by inputting Japanese character
あ
into the sentence below. (|
is cursor)The result is so strange:
anchorOffset
focusOffset
I think it's hard to fix, but it's a fact that the fix only for iOS affects Japanese input unexpectedly.
So my suggestion is checking platform before updating the selection.
What's the expected behavior?
I can submit PR if my suggestion is accepted.
The text was updated successfully, but these errors were encountered: