We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08ad2c9 commit 0c4f599Copy full SHA for 0c4f599
src/demo-app/tree/dynamic-tree-demo/dynamic-database.ts
@@ -100,13 +100,22 @@ export class DynamicDataSource {
100
}
101
node.isLoading = true;
102
103
+ let count = 0;
104
+
105
setTimeout(() => {
106
if (expand) {
107
const nodes = children.map(name =>
108
new DynamicFlatNode(name, node.level + 1, this.database.isExpandable(name)));
109
this.data.splice(index + 1, 0, ...nodes);
110
} else {
- this.data.splice(index + 1, children.length);
111
+ for (let i = index + 1; i < this.data.length; i++) {
112
+ if (this.data[i].level > node.level) {
113
+ count++;
114
+ } else {
115
+ break;
116
+ }
117
118
+ this.data.splice(index + 1, count);
119
120
121
// notify the change
0 commit comments