# HG changeset patch # User cin # Date 2021-09-01 23:49:41 # Node ID bc7556143fe536e3df374bc0070146311884284e # Parent f8ff12e26c2d151d328307783bded09fd58be4e9 bind event handler methods marked with `@on` before subscribing the event diff --git a/djx/src/main/ts/tsx/DjxWidgetBase.ts b/djx/src/main/ts/tsx/DjxWidgetBase.ts --- a/djx/src/main/ts/tsx/DjxWidgetBase.ts +++ b/djx/src/main/ts/tsx/DjxWidgetBase.ts @@ -62,7 +62,7 @@ export abstract class DjxWidgetBase { const handler = this[handlerMethod as keyof this]; if (typeof handler === "function") - this.on(eventName, handler); + this.on(eventName, handler.bind(this)); }); }