From 3c290c9fc501f7a314f13364c887e543428a11c1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 3 Mar 2025 21:20:42 +0200 Subject: [PATCH] fix(client): allow overriding position using getter (closes #1321) --- src/public/app/components/component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/public/app/components/component.ts b/src/public/app/components/component.ts index 416449fc7..e2897d1f3 100644 --- a/src/public/app/components/component.ts +++ b/src/public/app/components/component.ts @@ -18,7 +18,7 @@ export class TypedComponent> { children: ChildT[]; initialized: Promise | null; parent?: TypedComponent; - position!: number; + _position!: number; constructor() { this.componentId = `${this.sanitizedClassName}-${utils.randomString(8)}`; @@ -31,6 +31,14 @@ export class TypedComponent> { return this.constructor.name.replace(/[^A-Z0-9]/gi, "_"); } + get position() { + return this._position; + } + + set position(newPosition: number) { + this._position = newPosition; + } + setParent(parent: TypedComponent) { this.parent = parent; return this;