Skip to content

Conversation

@mikeangstadt
Copy link

@mikeangstadt mikeangstadt commented Nov 30, 2016

Fixes an IE 'Invalid Argument' exception with textareas:
Error happens, because (for whatever reason) IE temporarily converts <textarea placeholder="foo"></textarea> to <textarea placeholder="foo">foo</textarea>. This triggers a diff patch on the 'foo' innerHTML as a VTEXT node, but by the time vdom tries to set the VTEXT's value, it has been orphaned by IE.

IE throws an error whenever you try to set the nodeValue of a parentless node which exposes itself as an 'Invalid Argument' exception.

Error happens, because (for whatever reason) IE temporarily converts <textarea placeholder="foo"></textarea> to <textarea placeholder="foo">foo</textarea>. This triggers a diff patch on the 'foo' innerHTML as a VTEXT node, but by the time vdom tries to set the VTEXT's value, it has been orphaned by IE.

IE throws an error whenever you try to set the nodeValue of a parentless node which exposes itself as an 'Invalid Argument' exception.
@coveralls
Copy link

coveralls commented Nov 30, 2016

Coverage Status

Coverage remained the same at 97.531% when pulling 8aadfcb on mikeangstadt:master into 947ecf9 on Matt-Esch:master.

@panthershark
Copy link

Try always putting a value in the 3rd arg. Ex:

const attrs = { 
  "placeholder": 'dogs' 
};

h('textarea', attrs, '');

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

Successfully merging this pull request may close these issues.

3 participants