Skip to content

Commit

Permalink
[FIX] config: make enableTransitions work on components (#773)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ged-odoo committed Oct 20, 2020
1 parent 4e8e9de commit 392dc01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion doc/reference/event_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<MyCustomPayload>('my-custom-event', payload);
this.trigger<MyCustomPayload>("my-custom-event", payload);
```

```typescript
myCustomEventHandler(ev: OwlEvent<MyCustomPayload>) { ... }
```
Expand Down
2 changes: 1 addition & 1 deletion src/component/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export class Component<Props extends {} = any, T extends Env = Env> {
* up to the parent DOM nodes. Thus, it must be called between mounted() and
* willUnmount().
*/
trigger<T=any>(eventType: string, payload?: T) {
trigger<T = any>(eventType: string, payload?: T) {
this.__trigger<T>(this, eventType, payload);
}

Expand Down
4 changes: 3 additions & 1 deletion src/component/directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down

0 comments on commit 392dc01

Please sign in to comment.