@smartnet360/svelte-components 0.0.111 → 0.0.112
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.
|
@@ -190,21 +190,18 @@
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
// Track previous values to avoid unnecessary updates
|
|
193
|
-
let
|
|
194
|
-
let prevCellsFirstId: string | null = null;
|
|
193
|
+
let prevCellsRef: unknown[] | null = null;
|
|
195
194
|
let prevGroupBy: string | null = null;
|
|
196
195
|
let prevColumnPreset: string | null = null;
|
|
197
196
|
|
|
198
|
-
// Update table data when cells
|
|
197
|
+
// Update table data when cells change (reference comparison)
|
|
199
198
|
$effect(() => {
|
|
200
|
-
|
|
201
|
-
const
|
|
199
|
+
// Track the cells array reference to detect any change
|
|
200
|
+
const currentRef = sortedCells;
|
|
202
201
|
|
|
203
|
-
//
|
|
204
|
-
if (isInitialized && table &&
|
|
205
|
-
|
|
206
|
-
prevCellsLength = currentLength;
|
|
207
|
-
prevCellsFirstId = currentFirstId;
|
|
202
|
+
// Update if reference changed (new array assignment)
|
|
203
|
+
if (isInitialized && table && currentRef !== prevCellsRef) {
|
|
204
|
+
prevCellsRef = currentRef;
|
|
208
205
|
table.replaceData(sortedCells);
|
|
209
206
|
ondatachange?.({
|
|
210
207
|
type: 'load',
|