Skip to content

Commit 2213c50

Browse files
eliandoranJYC333
authored andcommitted
fix(client): allow overriding position using getter (closes #1321)
1 parent 8e66dc3 commit 2213c50

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/public/app/components/component.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class TypedComponent<ChildT extends TypedComponent<ChildT>> {
1818
children: ChildT[];
1919
initialized: Promise<void> | null;
2020
parent?: TypedComponent<any>;
21-
position!: number;
21+
_position!: number;
2222

2323
constructor() {
2424
this.componentId = `${this.sanitizedClassName}-${utils.randomString(8)}`;
@@ -31,6 +31,14 @@ export class TypedComponent<ChildT extends TypedComponent<ChildT>> {
3131
return this.constructor.name.replace(/[^A-Z0-9]/gi, "_");
3232
}
3333

34+
get position() {
35+
return this._position;
36+
}
37+
38+
set position(newPosition: number) {
39+
this._position = newPosition;
40+
}
41+
3442
setParent(parent: TypedComponent<any>) {
3543
this.parent = parent;
3644
return this;

0 commit comments

Comments
 (0)