svelte-select-5 6.1.4 → 6.1.5
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/Select.svelte +14 -6
- package/no-styles/Select.svelte +14 -6
- package/package.json +1 -1
package/Select.svelte
CHANGED
|
@@ -385,13 +385,18 @@
|
|
|
385
385
|
if (!value || (multiple ? value.some((selection) => !selection || !selection[itemId]) : !value[itemId])) return;
|
|
386
386
|
|
|
387
387
|
if (Array.isArray(value)) {
|
|
388
|
-
//
|
|
388
|
+
// Check if any value needs updating - compare properties, not references
|
|
389
|
+
// (Svelte 5 proxies have different identities than their targets)
|
|
389
390
|
let needsUpdate = false;
|
|
390
391
|
const newValue = value.map((selection) => {
|
|
391
392
|
const found = findItem(selection);
|
|
392
|
-
if
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
// Only update if found item has different properties (not just different reference)
|
|
394
|
+
if (found && found[itemId] === selection[itemId]) {
|
|
395
|
+
// Same itemId - check if other properties differ using JSON comparison
|
|
396
|
+
if (JSON.stringify(found) !== JSON.stringify(selection)) {
|
|
397
|
+
needsUpdate = true;
|
|
398
|
+
return found;
|
|
399
|
+
}
|
|
395
400
|
}
|
|
396
401
|
return selection;
|
|
397
402
|
});
|
|
@@ -400,8 +405,11 @@
|
|
|
400
405
|
}
|
|
401
406
|
} else {
|
|
402
407
|
const found = findItem();
|
|
403
|
-
if
|
|
404
|
-
|
|
408
|
+
// Only update if found item has different properties
|
|
409
|
+
if (found && found[itemId] === value[itemId]) {
|
|
410
|
+
if (JSON.stringify(found) !== JSON.stringify(value)) {
|
|
411
|
+
value = found;
|
|
412
|
+
}
|
|
405
413
|
}
|
|
406
414
|
}
|
|
407
415
|
}
|
package/no-styles/Select.svelte
CHANGED
|
@@ -385,13 +385,18 @@
|
|
|
385
385
|
if (!value || (multiple ? value.some((selection) => !selection || !selection[itemId]) : !value[itemId])) return;
|
|
386
386
|
|
|
387
387
|
if (Array.isArray(value)) {
|
|
388
|
-
//
|
|
388
|
+
// Check if any value needs updating - compare properties, not references
|
|
389
|
+
// (Svelte 5 proxies have different identities than their targets)
|
|
389
390
|
let needsUpdate = false;
|
|
390
391
|
const newValue = value.map((selection) => {
|
|
391
392
|
const found = findItem(selection);
|
|
392
|
-
if
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
// Only update if found item has different properties (not just different reference)
|
|
394
|
+
if (found && found[itemId] === selection[itemId]) {
|
|
395
|
+
// Same itemId - check if other properties differ using JSON comparison
|
|
396
|
+
if (JSON.stringify(found) !== JSON.stringify(selection)) {
|
|
397
|
+
needsUpdate = true;
|
|
398
|
+
return found;
|
|
399
|
+
}
|
|
395
400
|
}
|
|
396
401
|
return selection;
|
|
397
402
|
});
|
|
@@ -400,8 +405,11 @@
|
|
|
400
405
|
}
|
|
401
406
|
} else {
|
|
402
407
|
const found = findItem();
|
|
403
|
-
if
|
|
404
|
-
|
|
408
|
+
// Only update if found item has different properties
|
|
409
|
+
if (found && found[itemId] === value[itemId]) {
|
|
410
|
+
if (JSON.stringify(found) !== JSON.stringify(value)) {
|
|
411
|
+
value = found;
|
|
412
|
+
}
|
|
405
413
|
}
|
|
406
414
|
}
|
|
407
415
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-select-5",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.5",
|
|
4
4
|
"description": "A <Select> component for Svelte 5 apps (fork of svelte-select)",
|
|
5
5
|
"repository": "https://github.com/Dbone29/svelte-select-5.git",
|
|
6
6
|
"author": "Robert Balfré <rob.balfre@gmail.com> (https://github.com/rob-balfre)",
|