From 061cb168e5ef97914f6bfa071024cfc1049302ba Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Tue, 27 May 2014 22:27:10 -0400 Subject: [PATCH] fix textarea value updating --- docs/change-log.md | 9 +++++++++ mithril.js | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/change-log.md b/docs/change-log.md index eaeeac63..067263ae 100644 --- a/docs/change-log.md +++ b/docs/change-log.md @@ -1,5 +1,14 @@ ## Change Log +[v0.1.15](/mithril/archive/v0.1.15) - maintenance + +### Bug Fixes: + +- `m.sync` now correctly passes arguments to resolver in same order as input arguments [#96](https://github.com/lhorie/mithril.js/issues/96) +- updating textarea attributes updates its value correctly [#100](https://github.com/lhorie/mithril.js/issues/100) + +--- + [v0.1.14](/mithril/archive/v0.1.14) - maintenance ### News: diff --git a/mithril.js b/mithril.js index 8ad8ef58..d3f6d0c1 100644 --- a/mithril.js +++ b/mithril.js @@ -73,7 +73,7 @@ Mithril = m = new function app(window) { cached = { tag: data.tag, attrs: setAttributes(node, data.tag, data.attrs, {}, namespace), - children: build(node, data.tag, data.children, cached.children, true, 0, data.attrs.contenteditable ? node : editable, namespace), + children: data.children !== undefined ? build(node, data.tag, data.children, cached.children, true, 0, data.attrs.contenteditable ? node : editable, namespace) : undefined, nodes: [node] } parentElement.insertBefore(node, parentElement.childNodes[index] || null) @@ -155,7 +155,9 @@ Mithril = m = new function app(window) { else if (attrName === "value" && tag === "input") { if (node.value !== dataAttr) node.value = dataAttr } - else if (attrName in node && !(attrName == "list" || attrName == "style")) node[attrName] = dataAttr + else if (attrName in node && !(attrName == "list" || attrName == "style")) { + node[attrName] = dataAttr + } else node.setAttribute(attrName, dataAttr) } }