diff options
author | Jamie V <jamie.j.vigliotta@nasa.gov> | 2021-06-04 20:57:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-04 20:57:01 +0300 |
commit | f602790b1de0a01f8b7414e9812a3a29e0105112 (patch) | |
tree | 7e67ce744d828bd01e7793f0170c14f400f954ae | |
parent | 66893cd5db06a9102c38b88ef6ebe9928ab6e73e (diff) |
[Navigation Tree] Fix composition on closed folders and scrolling for items NOT in tree (#3920)v1.7.3
-rw-r--r-- | src/ui/layout/mct-tree.vue | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/ui/layout/mct-tree.vue b/src/ui/layout/mct-tree.vue index c9e5071c3..a541612bd 100644 --- a/src/ui/layout/mct-tree.vue +++ b/src/ui/layout/mct-tree.vue @@ -308,6 +308,7 @@ export default { || !checkItem.navigationPath.includes(path); }); this.openTreeItems.splice(pathIndex, 1); + this.removeCompositionListenerFor(path); }, closeTreeItem(item) { this.closeTreeItemByPath(item.navigationPath); @@ -393,12 +394,18 @@ export default { } const indexOfScroll = this.treeItems.findIndex(item => item.navigationPath === navigationPath); - const scrollTopAmount = indexOfScroll * this.itemHeight; - this.$refs.scrollable.scrollTo({ - top: scrollTopAmount, - behavior: 'smooth' - }); + if (indexOfScroll !== -1) { + const scrollTopAmount = indexOfScroll * this.itemHeight; + + this.$refs.scrollable.scrollTo({ + top: scrollTopAmount, + behavior: 'smooth' + }); + } else if (this.scrollToPath) { + this.scrollToPath = undefined; + delete this.scrollToPath; + } }, scrollEndEvent() { this.$nextTick(() => { |