ng-material-treetable icon indicating copy to clipboard operation
ng-material-treetable copied to clipboard

Tree not collapsing

Open leawp opened this issue 6 years ago • 1 comments

I have the following structure in my project and the first ng-treetable is not collapsing I can collapse the second component no problem. issue

As you can see I clicked on the second row but it didn't collapse these two tables are in a single component like so:

export class TasksComponent implements OnInit {
    chargeableTasks= taskTree;
    chargeableTasks2 = taskTree; // same object
    constructor() { }

    ngOnInit(): void { }
}
<mat-tab label="Chargeable">
        <div>
            <ng-treetable [tree]="chargeableTasks" id="xd">
            </ng-treetable>
        </div>
        <div>
            <ng-treetable [tree]="chargeableTasks2" id="xd2">
            </ng-treetable>
        </div>
</mat-tab>

So they reference the same object "taskTree" I imagine someone would need that for comparing two nodes of the same tree in split view or something.... Not sure if its a big issue since you can clone the object and be fine.

leawp avatar Feb 01 '19 20:02 leawp

Hi @pawelhandrysik thanks for reporting this. I think you are right, I very much suspect that the issue is caused by the object being the same in both trees. As you said, the immediate workaround is to clone the object and use separate copies, but there might be a use case where the original copy needs to be used in both trees. I'll try and see if I can come up with something.

mlrv avatar Feb 01 '19 22:02 mlrv