fix select.value so that it displays correct option on first render
This commit is contained in:
parent
661307c02e
commit
6bca818f34
2 changed files with 3 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
### Bug Fixes:
|
### Bug Fixes:
|
||||||
|
|
||||||
- fixed a subtree directive bug that happened in inputs inside loops
|
- fixed a subtree directive bug that happened in inputs inside loops
|
||||||
|
- fixed select.value so that the correct option is displayed on first render
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,8 +133,9 @@ Mithril = m = new function app(window) {
|
||||||
node = namespace === undefined ? window.document.createElement(data.tag) : window.document.createElementNS(namespace, data.tag)
|
node = namespace === undefined ? window.document.createElement(data.tag) : window.document.createElementNS(namespace, data.tag)
|
||||||
cached = {
|
cached = {
|
||||||
tag: data.tag,
|
tag: data.tag,
|
||||||
attrs: setAttributes(node, data.tag, data.attrs, {}, namespace),
|
//process children before attrs so that select.value works correctly
|
||||||
children: data.children !== undefined ? build(node, data.tag, undefined, undefined, data.children, cached.children, true, 0, data.attrs.contenteditable ? node : editable, namespace, configs) : undefined,
|
children: data.children !== undefined ? build(node, data.tag, undefined, undefined, data.children, cached.children, true, 0, data.attrs.contenteditable ? node : editable, namespace, configs) : undefined,
|
||||||
|
attrs: setAttributes(node, data.tag, data.attrs, {}, namespace),
|
||||||
nodes: [node]
|
nodes: [node]
|
||||||
}
|
}
|
||||||
parentElement.insertBefore(node, parentElement.childNodes[index] || null)
|
parentElement.insertBefore(node, parentElement.childNodes[index] || null)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue