hy-virtual-tree 1.1.62 → 1.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.js +10 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -425,8 +425,6 @@ class VirtualScroll {
|
|
|
425
425
|
this.contentWrapper.appendChild(this.contentContainer);
|
|
426
426
|
this.scrollContainer.appendChild(this.contentWrapper);
|
|
427
427
|
this.container.appendChild(this.scrollContainer);
|
|
428
|
-
this.emptyContainer = this.renderEmpty();
|
|
429
|
-
this.scrollContainer.appendChild(this.emptyContainer);
|
|
430
428
|
// Render initial visible items
|
|
431
429
|
this.renderVisibleItems(0, Math.min(100, this.items.length));
|
|
432
430
|
}
|
|
@@ -626,10 +624,17 @@ class VirtualScroll {
|
|
|
626
624
|
*/
|
|
627
625
|
switchEmpty(show = true) {
|
|
628
626
|
if (show) {
|
|
629
|
-
|
|
627
|
+
const newEmptyContainer = this.renderEmpty();
|
|
628
|
+
if (this.emptyContainer) {
|
|
629
|
+
this.scrollContainer.removeChild(this.emptyContainer);
|
|
630
|
+
this.emptyContainer = null;
|
|
631
|
+
}
|
|
632
|
+
this.emptyContainer = newEmptyContainer;
|
|
633
|
+
this.scrollContainer.appendChild(this.emptyContainer);
|
|
630
634
|
}
|
|
631
|
-
else {
|
|
632
|
-
this.
|
|
635
|
+
else if (this.emptyContainer) {
|
|
636
|
+
this.scrollContainer.removeChild(this.emptyContainer);
|
|
637
|
+
this.emptyContainer = null;
|
|
633
638
|
}
|
|
634
639
|
}
|
|
635
640
|
}
|