From ec5442899e8380ab552b76575616618e74fbfd75 Mon Sep 17 00:00:00 2001 From: Aylur Date: Thu, 9 Nov 2023 00:51:31 +0100 Subject: [PATCH] fix(widget): child setter --- src/widgets/widget.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/widgets/widget.ts b/src/widgets/widget.ts index c372220..fc239a7 100644 --- a/src/widgets/widget.ts +++ b/src/widgets/widget.ts @@ -276,6 +276,12 @@ export default function (Widget: T, GTypeName?: string) { if (typeof this.set_child === 'function') // @ts-expect-error this.set_child(child); + + // @ts-expect-error + else if (typeof this.add === 'function') + // @ts-expect-error + this.add(child); + else console.error(Error(`can't set child on ${this}`)); }