Skip to content

Commit a92de70

Browse files
committed
Fix scroll area append child
1 parent 900106e commit a92de70

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

projects/angular-nodegui/src/lib/components/scroll-area.ts

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { QScrollArea } from '@nodegui/nodegui';
1+
import { QScrollArea, FlexLayout } from '@nodegui/nodegui';
22
import { NgComponent } from './component';
33
import { RendererStyleFlags2 } from '@angular/core';
44

@@ -7,10 +7,16 @@ export class NgScrollArea extends QScrollArea implements NgComponent {
77
public parent: any;
88

99
public appendChild(newChild: any): void {
10-
throw new Error('Method not implemented.');
10+
if (this.contentWidget) {
11+
console.warn('ScrollView cant have more than one child node');
12+
return;
13+
}
14+
this.setWidget(newChild);
1115
}
1216

13-
public insertBefore(newChild: any, refChild: any) {}
17+
public insertBefore(newChild: any, refChild: any) {
18+
throw new Error('Method not implemented.');
19+
}
1420

1521
public setNgAttribute(
1622
name: string,
@@ -44,9 +50,15 @@ export class NgScrollArea extends QScrollArea implements NgComponent {
4450
removeAttribute(name: string, namespace?: string): void {
4551
throw new Error('Method not implemented.');
4652
}
53+
4754
removeChild(oldChild: any): void {
48-
throw new Error('Method not implemented.');
55+
const removedChild = this.takeWidget();
56+
if (removedChild) {
57+
removedChild.close();
58+
}
59+
oldChild.close();
4960
}
61+
5062
removeClass(name: string): void {
5163
throw new Error('Method not implemented.');
5264
}

0 commit comments

Comments
 (0)