Mithril.js: <textarea> in IE9 and IE10

Created on 12 Jun 2017  路  4Comments  路  Source: MithrilJS/mithril.js

In IE9 and IE10, the cursor jumps to the end of the text in the <textarea> when typing.

var data = {
  text: 'Lorem ipsum dolor sit amet'
}

var App = {
  view: function (v) {
    return [
      m('textarea', {
        'value': data.text,
        'oninput': m.withAttr('value', function (value) { data.text = value })
      }),
      m('pre', data.text)
    ]
  }
}

m.mount(document.body, App)

Fiddle here. IE10 should just work. On IE9, visit the link above, log in, and then go to https://jsfiddle.net/draft/ to see the code running.

  1. Place cursor after the r in dolor.
  2. Try to type es

Expected

Lorem ipsum dolores sit amet

Actual

Lorem ipsum dolore sit amets

Bug

Most helpful comment

@pygy Thank you! I can confirm that the fiddle you sent works correctly.

All 4 comments

Thanks for the report. This will probably be fixed by adding textarea.value to the attrs special cases in setAttr.

1871 fixes it in IE10 I don't have a JSFiddle account, could you give https://jsfiddle.net/y1ax6nv6/ a try ?

(based on https://github.com/pygy/mithril.js/blob/fix-1870-build/mithril.js)

@andraaspar this should be fixed in git HEAD

@pygy Thank you! I can confirm that the fiddle you sent works correctly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

volnei picture volnei  路  3Comments

pygy picture pygy  路  3Comments

designMoreWeb picture designMoreWeb  路  4Comments

tivac picture tivac  路  3Comments

josephys picture josephys  路  4Comments