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

WIP ignore IME key clicks #661

Closed
wants to merge 1 commit into from
Closed

WIP ignore IME key clicks #661

wants to merge 1 commit into from

Conversation

iezer
Copy link
Collaborator

@iezer iezer commented Dec 13, 2018

Partial fix for #548. This fixes Korean and Japanese input (using Input Method Editor IME) for most cases.

Editor is still broken when entering text at the beginning of a section. Still working on that. Fixing this will probably involve fixing #589, ie. don't do a full re-render when not needed. This also effects spellcheck and Android input.

Basically the keys Enter, Backspace, Space, Tab, and Arrows are all used to navigate and select within the IME editor so we want mobiledoc to ignore those.

Illustration of the bug:

Pressing Enter

Pressing Backspace

  • Pressing backspace seems to duplicate the previous character

After fixed

Still broken at start of section

  • Notice the "w" goes straight to the document and is not part of the IME input

We want to skip the usual special behavior for ENTER and DELETE when the user is using IME.
@mixonic
Copy link
Contributor

mixonic commented Dec 13, 2018

@iezer are there docs for the IME APIs? I was looking into it and I wasn't sure if FireFox and Chrome have the same APIs here, or if they are standard/non-standard etc.

Looking good.

@iezer
Copy link
Collaborator Author

iezer commented Dec 13, 2018

@mixonic I found some docs here but I'm not sure if they're relevant. https://www.chromium.org/developers/design-documents/extensions/proposed-changes/apis-under-development/input-method-editor

The IME interface is at the OS level so it's the same on all browsers and text-editors, even in the terminal!

I just tested this on Firefox and Safari and it works.

@siygle
Copy link

siygle commented Jan 15, 2019

Sorry for asking, any update on this PR? Hope this could merge soon and the IME issue could be solved. :)

@kwmr-zz
Copy link

kwmr-zz commented Jun 3, 2019

If this bug remains for a long time, no Japanese or Koreans will use it. I WANT SOME- THING TO FIX IT...

@hq5544
Copy link

hq5544 commented Jul 2, 2019

This problem troubles me such a long time.
Hope this PR can be merged soon.
@kevinansfield

@tohutohu
Copy link

I strongly hope that this PR will be merged early.
If there is a reason for not being merged, please tell us why.

@xufangda
Copy link

xufangda commented Dec 1, 2019

Merge it Please!!!

@bin16
Copy link

bin16 commented Dec 2, 2019

@gpoitch The feature is important for all users who need input method.

@gpoitch
Copy link
Member

gpoitch commented Dec 2, 2019

@bin16 the PR is still incomplete according to the author @iezer. Happy to help push it along if the author or someone else can step up and finish it or confirm it's working as-is. I am no longer contributing to this project.

@xufangda
Copy link

xufangda commented Dec 5, 2019

@bin16 the PR is still incomplete according to the author @iezer. Happy to help push it along if the author or someone else can step up and finish it or confirm it's working as-is. I am no longer contributing to this project.

Thanks so much for reply. This PR has been proved to be effective by @soulteary. The author @iezer has pointed out that this PR solves problem #548, and this is the biggest problem for every asian user.

The so called incomplete refers to issue #589. We can wait for people proposing a new PR. Please merge this PR first.

@bin16
Copy link

bin16 commented Dec 12, 2019

I've checked, the PR is a partial fix. It's broken when you insert with IME to an empty section. e.g. typing ceshi with IME, c is caught by editor, and IME take eshi only.

@bin16
Copy link

bin16 commented Dec 12, 2019

@iezer You can replace key.isIME() with event.isComposing, https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/isComposing

The API is not supported by some browsers(IE), but it would not be worse. https://caniuse.com/#feat=mdn-api_keyboardevent_iscomposing.

@ZeeJab
Copy link
Contributor

ZeeJab commented Jul 15, 2020

Superseded by #738

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.

10 participants