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

Use keypress instead of keyup in onEnter #12

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

Conversation

jinjor
Copy link

@jinjor jinjor commented Jan 27, 2018

This is a problem specific to a particular situation.

Japanese text are input by pressing Enter key twice.

  1. Choose correct letters
  2. Finish editing

The problem is that onEnter handles event on the timing (1) instead of (2).

For example, when we Japanese type kansuu, there are many way to express it. (1) Show kansuu directly (2) convert to かんすう (3) convert to 関数 (4) convert to 巻数... This functionality is called IME (Input Method Editor).

screen shot 2018-01-27 at 23 10 15

When we want to input "関数って最高だよね", we first type kansuu and then choose 関数 using Enter key. Now we haven't finished inputting the whole text yet, but onEnter event is unexpectedly emitted.

As far as I know, using keypress instead of keyup solves this problem. But I'm not sure if this change causes any downside or not. I will really appreciate if someone could review this.

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