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

<textarea> in IE9 and IE10 #1870

Closed
andraaspar opened this Issue Jun 12, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@andraaspar
Copy link
Contributor

andraaspar commented Jun 12, 2017

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

@pygy

This comment has been minimized.

Copy link
Member

pygy commented Jun 12, 2017

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

@pygy pygy added the bug label Jun 12, 2017

pygy added a commit to pygy/mithril.js that referenced this issue Jun 12, 2017

pygy added a commit to pygy/mithril.js that referenced this issue Jun 12, 2017

@pygy

This comment has been minimized.

Copy link
Member

pygy commented Jun 12, 2017

#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)

@pygy pygy closed this in 60e999f Jun 13, 2017

pygy added a commit that referenced this issue Jun 13, 2017

Merge pull request #1871 from pygy/fix-1870
Don't update textarea.value if the `DOM.value === vdom.value !== old.value`, Fix #1870
@pygy

This comment has been minimized.

Copy link
Member

pygy commented Jun 13, 2017

@andraaspar this should be fixed in git HEAD

@andraaspar

This comment has been minimized.

Copy link
Contributor

andraaspar commented Jun 13, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment