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

Trouble with input Japanese characters when rapidly typing #62

Closed
jinjor opened this issue Jul 22, 2016 · 6 comments
Closed

Trouble with input Japanese characters when rapidly typing #62

jinjor opened this issue Jul 22, 2016 · 6 comments

Comments

@jinjor
Copy link

jinjor commented Jul 22, 2016

This issue is very hard to explain, but it's actually happening.
(For Japanese, this issue is about "高速にタイプすると途中で変換できなくなる件".)

Japanese people type Japanese characters through converting alphabets like this. When I want to input こんにちは, I type konnichiha. Also, during typing, browser shows the text (こんにちは) with underline. This underline indicates "This text is not yet determined, you can also choose alternative plans to describe konnichiha". All of こんにちは, 今日は and コンニチハ can be converted from konnichiha. So we choose one of them before finishing typing. To summarize, this "undetermined state" is important.

Now, the problem is, when "value" attribute of input element is set by program, this "undetermined state" suddenly disappears. Basically, this does not happen because the value in Elm is always equal to the value of input element. But when I type rapidly, it behaves unexpectedly.

Type slowly

action DOM value Elm value Applying patch
type "r" りr
りr no change
type "i" りり
りり no change

Type rapidly

action DOM value Elm value Applying patch
type "r" りr
type "i" りり
りr りr りり ⇒ りr
りり りり りr ⇒ りり

The last two needless changes cause disappearance of "undetermined state". I confirmed this happens only when this line is evaluated. I think this is common issue in Chinese too.

If you can type this kind of language, I also created an example at jsFiddle, which is not Elm but able to see the behavior.

Thanks.


OS: Windows 7
Browser: Chrome 51
Elm: 0.17.0
elm-lang/core: 4.0.3
elm-lang/html: 1.1.0

@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@jinjor
Copy link
Author

jinjor commented Jul 22, 2016

P.S.
Sorry for not showing SSCCE. It is hard to reproduce...

@evancz
Copy link
Member

evancz commented Jul 22, 2016

There's an issue on this repo or on virtual-dom that talks about "unmanaged inputs" which basically means you do not add a value property on the input. Just let it do its own thing and track it internally. This means you cannot modify the field with value, but it should fix this issue. Can you link that issue in this thread if you find it?

@jinjor
Copy link
Author

jinjor commented Jul 25, 2016

Maybe this one? I haven't read all of this discussion but I confirmed defaultValue attribute instead of value works well. Thank you.

@rtfeldman
Copy link
Member

This is the issue - it's on the old evancz/elm-html repo

@evancz
Copy link
Member

evancz commented Jul 7, 2017

Tracking in https://github.com/elm-lang/virtual-dom/issues/107. Thank you for the report!

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

No branches or pull requests

4 participants