diff --git a/mithril.js b/mithril.js index 9595a439..e0b464cc 100644 --- a/mithril.js +++ b/mithril.js @@ -727,13 +727,6 @@ cached.children.nodes = [] } - // edge case: setting value on doesn't work before children + // exist, so set it again after children have been created/updated + if (data.tag === "select" && "value" in data.attrs) { + setAttributes(node, data.tag, {value: data.attrs.value}, {}, + namespace) + } + if (!isNew && shouldReattach === true && node != null) { insertNode(parentElement, node, index) } diff --git a/test/mithril.render.js b/test/mithril.render.js index 9cd0c95c..c2c56b5a 100644 --- a/test/mithril.render.js +++ b/test/mithril.render.js @@ -1567,5 +1567,15 @@ describe("m.render()", function () { expect(root.childNodes[0].innerHTML) .to.equal('') }) + + it("sets correct