[Navigation Tree] Prevent showing "no items" while still loading (#3341)

* no  showing "no items" if still loading

* added additional no items variable to handle dictionary composition loading race conditions

* code cleanup

* more descript variable name
This commit is contained in:
Jamie V 2020-08-31 11:23:50 -07:00 committed by GitHub
parent efd97de743
commit 91d1681698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,7 +76,7 @@
@expanded="handleExpanded"
/>
<li
v-if="visibleItems.length === 0"
v-if="visibleItems.length === 0 && !noVisibleItems"
:style="emptyStyles()"
class="c-tree__item c-tree__item--empty"
>
@ -140,7 +140,8 @@ export default {
getChildHeight: false,
settingChildrenHeight: false,
isMobile: isMobile.mobileName,
multipleRootChildren: false
multipleRootChildren: false,
noVisibleItems: false
};
},
computed: {
@ -318,6 +319,7 @@ export default {
this.noScroll = true;
}
this.noVisibleItems = false;
this.updatevisibleItems();
});
} else {
@ -565,6 +567,7 @@ export default {
return;
}
this.noVisibleItems = true;
this.visibleItems = [];
await this.$nextTick(); // prevents "ghost" image of visibleItems
this.childrenSlideClass = 'slide-left';