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

[IME] Wrong character deletion after inputting Japanese character #810

Closed
nek023 opened this issue May 10, 2017 · 2 comments
Closed

[IME] Wrong character deletion after inputting Japanese character #810

nek023 opened this issue May 10, 2017 · 2 comments

Comments

@nek023
Copy link

nek023 commented May 10, 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 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.

@ianstormtaylor
Copy link
Owner

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!

@danburzo
Copy link
Contributor

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 nek023 changed the title Wrong character deletion after inputting Japanese character [IME] Wrong character deletion after inputting Japanese character Aug 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants