[FIX] qweb: properly handle empty class attribute

The classList.add method actually crashes when given an empty string (or
a string with just white spaces).

closes #530
This commit is contained in:
Géry Debongnie
2019-12-03 14:02:58 +01:00
committed by aab-odoo
parent 286090efca
commit f12d3373c9
5 changed files with 91 additions and 8 deletions
+1 -1
View File
@@ -219,7 +219,7 @@ function updateClass(oldVnode: VNode, vnode: VNode): void {
elm = vnode.elm as Element;
for (name in oldClass) {
if (!klass[name]) {
if (name && !klass[name]) {
elm.classList.remove(name);
}
}