Vue: <textarea> and <input type=text> cursor issue in IE 11.0

Created on 23 Feb 2017  ·  13Comments  ·  Source: vuejs/vue

To reproduce:

  • open https://vuejs.org/v2/guide/forms.html#Multiline-text with IE 11.0 (Edge) on Windows 7
  • type some text in the textarea
  • move the cursor at the beginning of the text (press the Home key)
  • quickly type random chars
    => the cursor jumps to the end

same issue with input type=text (https://vuejs.org/v2/guide/forms.html#Text)

improvement

All 13 comments

Hi, thanks for opening the issue!
You can also do it by using ctrl + ←

I can't reproduce this in Edge 15 or IE11 🤷

@jdalton Hey thanks for tuning in. Do you think it got patched on IE 11 in the meanwhile? I'll have to try again

IE 11 isn't getting patches like that, so not likely.

It seems to still be happening:
uoeu

Ah ha! It's a tricky one! After trying it a few more times I could repro in IE11 too.
Still not able to repo in Edge 15 though 😃

yeah, it doesn't happen on edge

I tried and was unable to reproduce in IE11 version 11.1066.14393.0 (Windows 10) (Update Versions: 11.0.41)
or in edge 38.14393.1066.0

Same on safari 11.0 (13604.1.38.1.6) (macOS) and earlier versions

vue-input

Try use custom component with input, like this:
https://vuejs.org/v2/guide/components.html#Form-Input-Components-using-Custom-Events

error is caused by
this.$emit("input",...)

I'm having this exact issue but it also happens in Chrome 68. Does anyone have a workaround?

@yyx990803 I have the feeling this is just caused by people using .trim as this causes the input to re-render often (and then the cursor jumps). A simple solution would be to add .trimlazy which only trims after a change event.

Is this issue fixed? I'm facing similar issue, can anyone help to fix this?

@ThomHurks You can nest modifiers, like v-model.trim.lazy - https://jsfiddle.net/782y3e5g/

Can anyone see if this fixes the issue on the older browsers?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gkiely picture gkiely  ·  3Comments

lmnsg picture lmnsg  ·  3Comments

paceband picture paceband  ·  3Comments

bfis picture bfis  ·  3Comments

julianxhokaxhiu picture julianxhokaxhiu  ·  3Comments