diff --git a/src/qweb.ts b/src/qweb.ts index d345d753..e994e667 100644 --- a/src/qweb.ts +++ b/src/qweb.ts @@ -1091,7 +1091,7 @@ const widgetDirective: Directive = { ctx.addLine(`extra.promises.push(def${defID});`); - if (node.getAttribute("t-if") || node.getAttribute("t-else")) { + if (node.hasAttribute("t-if") || node.hasAttribute("t-else")) { ctx.closeIf(); } diff --git a/tests/component.test.ts b/tests/component.test.ts index bea82b43..a0253386 100644 --- a/tests/component.test.ts +++ b/tests/component.test.ts @@ -1040,6 +1040,29 @@ describe("other directives with t-widget", () => { await widget.updateState({ flag: false }); expect(normalize(fixture.innerHTML)).toBe("