mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] vdom: performance improvement
Port from original snabbdom project: snabbdom/snabbdom#634 The issue is that before this commit, the removeClass method was sometimes called even if it is not useful. See this comment for more detail: https://github.com/snabbdom/snabbdom/issues/633#issue-618706258
This commit is contained in:
committed by
Géry Debongnie
parent
ad42c583c6
commit
9cfafc30b5
+2
-1
@@ -231,7 +231,8 @@ function updateClass(oldVnode: VNode, vnode: VNode): void {
|
||||
elm = vnode.elm as Element;
|
||||
|
||||
for (name in oldClass) {
|
||||
if (name && !klass[name]) {
|
||||
if (name && !klass[name] && !Object.prototype.hasOwnProperty.call(klass, name)) {
|
||||
// was `true` and now not provided
|
||||
elm.classList.remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user