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

Add fix for Chinese and Japanese characters #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

logancarter
Copy link

There was a problem with typing in Japanese/Chinese characters. The first character would be repeated twice, and this would only happen on the first line of the text box.

It is because we are calling this document.execCommand('formatBlock', false, 'p') before the characters are finalized. The 'compositionend' event happens when the characters are finalized. So I made a check for whether a "composition" is in progress and don't call document.execCommand('formatBlock', false, 'p') until then.

It shouldn't affect typing with English characters at all.


Some examples of what the problem was in Japanese ->
arigatou-> should be ありがとう but shows up as あありがとう
kyou -> should be 今日 but ends up as k今日

The first character is automatically saved, but it shouldn't be final until you indicate so using the Japanese or Chinese keyboard input method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant