diff --git a/runtime/vdom/Node.js b/runtime/vdom/Node.js index 166e4d4fb..be40e799c 100644 --- a/runtime/vdom/Node.js +++ b/runtime/vdom/Node.js @@ -63,6 +63,8 @@ Node.prototype = { }, $__appendChild: function(child) { + this.$__childCount++; + if (this.$__isTextArea) { if (child.$__Text) { var childValue = child.nodeValue; @@ -77,8 +79,6 @@ Node.prototype = { assignNamespace(child, namespaceURI); } - this.$__childCount++; - var lastChild = this.$__lastChild; child.$__parentNode = this; diff --git a/test/autotests/widgets-browser/textarea/index.marko b/test/autotests/widgets-browser/textarea/index.marko new file mode 100644 index 000000000..c1113b80f --- /dev/null +++ b/test/autotests/widgets-browser/textarea/index.marko @@ -0,0 +1,18 @@ + +
+

Code Editor

+
+ +
+ +
${state.errorText}
+
diff --git a/test/autotests/widgets-browser/textarea/test.js b/test/autotests/widgets-browser/textarea/test.js new file mode 100644 index 000000000..66e94c0e9 --- /dev/null +++ b/test/autotests/widgets-browser/textarea/test.js @@ -0,0 +1,12 @@ +var expect = require('chai').expect; + +module.exports = function(helpers) { + var widget = helpers.mount(require('./index.marko')); + + expect(widget.el.querySelector('pre').innerHTML).to.equal(''); + + widget.submit(); + widget.update(); + + expect(widget.el.querySelector('pre').innerHTML).to.equal('Placeholder error'); +}; \ No newline at end of file