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

Cursor jump on Safari #174

Closed
jinjor opened this issue Aug 30, 2018 · 5 comments
Closed

Cursor jump on Safari #174

jinjor opened this issue Aug 30, 2018 · 5 comments

Comments

@jinjor
Copy link

jinjor commented Aug 30, 2018

This code is problematic on Safari. (No problem on Chrome and Firefox)

input [ value = model.value, onInput = Input ] []

When any character is input, the cursor jumps to the end of the input.

SSCCE:
https://ellie-app.com/3c4pB2jrR8Ca1

4912804 says there should be no need to use defaultValue for workaround, but it still happens.


  • elm 0.19
  • elm/html 1.0.0
  • Safari
  • macOS Sierra
@jinjor
Copy link
Author

jinjor commented Aug 30, 2018

Also, this seems to cause another problem in Japanese input (or other language which uses IME).

expected
image

actual
image

IME should not commit any input until Enter key is pressed, but onSafari it does on every keypress.

@jinjor
Copy link
Author

jinjor commented Aug 31, 2018

Someone in elm-jp community found that 0.19 alpha does not have this problem, and this commit should be the root cause.

elm/virtual-dom@942a5e6#diff-e9aea911dda84230fda6fa81f6a0866bR496

Apparently key !== 'value' || key !== 'checked' is always true!
I'm not confident about how to fix it, but is this enough info for you @evancz ?

Edit:
Maybe (key !== 'value' && key !== 'checked') || domNode[key] !== value is the right condition?

@decioferreira
Copy link

this relates to elm/virtual-dom/issues/134 and elm/virtual-dom/pull/135

@evancz
Copy link
Member

evancz commented Sep 12, 2018

Some core team folks reviewed elm/virtual-dom#135, and they tell me it should fix this. Can do a patch soon.

@evancz evancz closed this as completed Sep 12, 2018
@jinjor
Copy link
Author

jinjor commented Sep 12, 2018

Nice, thank you!

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

3 participants