From 392dc0131a696a8e02969969d459774f17afcb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 20 Oct 2020 17:30:08 +0200 Subject: [PATCH] [FIX] config: make enableTransitions work on components (#773) Fun: the transition is handled at two different places, once for dom nodes, once for components. Obviously, I only applied the change to the first case and forgot about the second. --- doc/reference/event_handling.md | 3 ++- src/component/component.ts | 2 +- src/component/directive.ts | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/reference/event_handling.md b/doc/reference/event_handling.md index 4cbd3c787..77fd091bb 100644 --- a/doc/reference/event_handling.md +++ b/doc/reference/event_handling.md @@ -85,8 +85,9 @@ Note that if you work with Typescript, the `trigger` method is generic on the ty You can then describe the type of the event, so you will see typing errors... ```typescript -this.trigger('my-custom-event', payload); +this.trigger("my-custom-event", payload); ``` + ```typescript myCustomEventHandler(ev: OwlEvent) { ... } ``` diff --git a/src/component/component.ts b/src/component/component.ts index f172bcff9..17f000dcf 100644 --- a/src/component/component.ts +++ b/src/component/component.ts @@ -433,7 +433,7 @@ export class Component { * up to the parent DOM nodes. Thus, it must be called between mounted() and * willUnmount(). */ - trigger(eventType: string, payload?: T) { + trigger(eventType: string, payload?: T) { this.__trigger(this, eventType, payload); } diff --git a/src/component/directive.ts b/src/component/directive.ts index 01281d4f0..72aae3c38 100644 --- a/src/component/directive.ts +++ b/src/component/directive.ts @@ -227,7 +227,9 @@ QWeb.addDirective({ if (name.startsWith("t-on-")) { events.push([name, value]); } else if (name === "t-transition") { - transition = value; + if (QWeb.enableTransitions) { + transition = value; + } } else if (!name.startsWith("t-")) { if (name !== "class" && name !== "style") { // this is a prop!