Skip to content
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

Make sure textarea child node bindings also set the .value of the textarea #11

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,10 @@ function Binding() {
Binding.prototype.type = 'Binding';
Binding.prototype.update = function() {
this.template.update(this.context, this);

if (this.node && this.node.parentElement.tagName === 'TEXTAREA') {
this.node.parentElement.value = this.node.data;
}
};

function NodeBinding(template, context, node) {
Expand Down Expand Up @@ -916,7 +920,7 @@ function escapeAttribute(string) {
//// IE shims & workarounds ////

// General notes:
//
//
// In all cases, Node.insertBefore should have `|| null` after its second
// argument. IE works correctly when the argument is ommitted or equal
// to null, but it throws and error if it is equal to undefined.
Expand Down Expand Up @@ -955,7 +959,7 @@ function setNodeProperty(node, key, value) {

// In IE, input.defaultValue doesn't work correctly, so use input.value,
// which mistakenly but conveniently sets both the value property and attribute.
//
//
// Surprisingly, in IE <=7, input.defaultChecked must be used instead of
// input.checked before the input is in the document.
// http://webbugtrack.blogspot.com/2007/11/bug-299-setattribute-checked-does-not.html
Expand Down