Unbreak m.trust (#2516)
* Actually return the check from `maybeSetContentEditable` Lots of code paths relied on it being a boolean. When I created the abstraction, I apparently forgot to make sure it returned the result. * Don't forget to copy instance state over * Update changelog [skip ci] * Fix changelog issue [skip ci]
This commit is contained in:
parent
bcf427a3be
commit
30ad45caa1
5 changed files with 84 additions and 3 deletions
|
|
@ -434,7 +434,11 @@ module.exports = function($window) {
|
|||
removeHTML(parent, old)
|
||||
createHTML(parent, vnode, ns, nextSibling)
|
||||
}
|
||||
else vnode.dom = old.dom, vnode.domSize = old.domSize
|
||||
else {
|
||||
vnode.dom = old.dom
|
||||
vnode.domSize = old.domSize
|
||||
vnode.instance = old.instance
|
||||
}
|
||||
}
|
||||
function updateFragment(parent, old, vnode, hooks, nextSibling, ns) {
|
||||
updateNodes(parent, old.children, vnode.children, hooks, nextSibling, ns)
|
||||
|
|
@ -608,13 +612,14 @@ module.exports = function($window) {
|
|||
if (vnode.attrs == null || (
|
||||
vnode.attrs.contenteditable == null && // attribute
|
||||
vnode.attrs.contentEditable == null // property
|
||||
)) return
|
||||
)) return false
|
||||
var children = vnode.children
|
||||
if (children != null && children.length === 1 && children[0].tag === "<") {
|
||||
var content = children[0].children
|
||||
if (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content
|
||||
}
|
||||
else if (vnode.text != null || children != null && children.length !== 0) throw new Error("Child node of a contenteditable must be trusted")
|
||||
return true
|
||||
}
|
||||
|
||||
//remove
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue