workaround for filter + create child problems

This commit is contained in:
zadam
2020-11-29 20:55:24 +01:00
parent 2338a13749
commit 1c5425c9eb
3 changed files with 18 additions and 8 deletions

View File

@@ -1123,6 +1123,11 @@ export default class NoteTreeWidget extends TabAwareWidget {
await newActiveNode.setFocus(true);
}
}
if (noteIdsToReload.size > 0 || noteIdsToUpdate.size > 0) {
// workaround for https://github.com/mar10/fancytree/issues/1054
this.filterHoistedBranch();
}
}
sortChildren(node) {
@@ -1185,7 +1190,12 @@ export default class NoteTreeWidget extends TabAwareWidget {
filterHoistedBranch() {
if (this.tabContext) {
this.tree.filterBranches(node => node.data.noteId === this.tabContext.hoistedNoteId);
if (this.tabContext.hoistedNoteId === 'root') {
this.tree.clearFilter();
}
else {
this.tree.filterBranches(node => node.data.noteId === this.tabContext.hoistedNoteId);
}
}
}