mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: fix overlapping multi-class in t-att-class
Previously, if two attributes in t-att-class shared some classes, their presence would be determined by the last attribute declared, instead of being present if any attribute containing it evaluates to true. This commit fixes that.
This commit is contained in:
committed by
Géry Debongnie
parent
9fe2da704e
commit
b242230e20
@@ -24,4 +24,13 @@ describe("qweb t-att", () => {
|
||||
'<div class="a b c"></div>'
|
||||
);
|
||||
});
|
||||
|
||||
test("t-att-class with multiple classes, some of which are duplicate", () => {
|
||||
expect(render(`<div t-att-class="{'a b c': value, 'a b d': !value}" />`, { value: true })).toBe(
|
||||
'<div class="a b c"></div>'
|
||||
);
|
||||
expect(render(`<div t-att-class="{'a b c': value, 'a b d': !value}" />`, { value: false })).toBe(
|
||||
'<div class="a b d"></div>'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user