@shival99/z-ui 1.7.12 → 1.7.13
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.
|
@@ -3547,7 +3547,10 @@ class ZTableComponent {
|
|
|
3547
3547
|
const totalRows = untracked(() => this.table.getRowModel().rows.length);
|
|
3548
3548
|
return Math.ceil(totalRows / this.groupSize());
|
|
3549
3549
|
}, ...(ngDevMode ? [{ debugName: "_virtualGroupCount" }] : []));
|
|
3550
|
+
_virtualResetVersion = signal(0, ...(ngDevMode ? [{ debugName: "_virtualResetVersion" }] : []));
|
|
3550
3551
|
virtualizer = injectVirtualizer(() => {
|
|
3552
|
+
// Track reset version to force virtualizer re-initialization
|
|
3553
|
+
this._virtualResetVersion();
|
|
3551
3554
|
const groups = this.dynamicGroups();
|
|
3552
3555
|
const rowHeight = this.virtualRowHeight();
|
|
3553
3556
|
const groupSize = this.groupSize();
|
|
@@ -3567,6 +3570,7 @@ class ZTableComponent {
|
|
|
3567
3570
|
},
|
|
3568
3571
|
measureElement: (element) => element.getBoundingClientRect().height,
|
|
3569
3572
|
overscan: this._virtualConfig().overscan ?? Z_DEFAULT_VIRTUAL_OVERSCAN,
|
|
3573
|
+
initialOffset: 0,
|
|
3570
3574
|
};
|
|
3571
3575
|
});
|
|
3572
3576
|
_measureVirtualItems = effect(() => {
|
|
@@ -3706,6 +3710,8 @@ class ZTableComponent {
|
|
|
3706
3710
|
this.virtualizer.scrollToOffset(0);
|
|
3707
3711
|
// Force recalculate dynamic groups immediately
|
|
3708
3712
|
this._dynamicGroupsVersion.update(v => v + 1);
|
|
3713
|
+
// Force virtualizer to reset with initialOffset: 0
|
|
3714
|
+
this._virtualResetVersion.update(v => v + 1);
|
|
3709
3715
|
}
|
|
3710
3716
|
queueMicrotask(() => {
|
|
3711
3717
|
this._checkVerticalScroll();
|
|
@@ -3741,6 +3747,7 @@ class ZTableComponent {
|
|
|
3741
3747
|
if (this.isVirtual()) {
|
|
3742
3748
|
this.virtualizer.scrollToOffset(0);
|
|
3743
3749
|
this._dynamicGroupsVersion.update(v => v + 1);
|
|
3750
|
+
this._virtualResetVersion.update(v => v + 1);
|
|
3744
3751
|
}
|
|
3745
3752
|
this._checkScrollState();
|
|
3746
3753
|
});
|