Matt-Esch / virtual-dom

A Virtual DOM and diffing algorithm
MIT License
11.67k stars 777 forks source link

Fixed IE issue #417

Open mikeangstadt opened 7 years ago

mikeangstadt commented 7 years ago

Fixes an IE 'Invalid Argument' exception with textareas: Error happens, because (for whatever reason) IE temporarily converts to . 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 commented 7 years ago

Coverage Status

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

panthershark commented 7 years ago

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

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

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