virtua 0.48.5 → 0.48.6

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.
@@ -70,6 +70,9 @@
70
70
  let negative = $derived(stateVersion && scroller.$isNegative());
71
71
 
72
72
  let indexes = $derived.by(() => {
73
+ // https://github.com/inokawa/virtua/pull/847
74
+ const len = data.length;
75
+
73
76
  const [start, end] = range;
74
77
  const arr: number[] = [];
75
78
  if (keepMounted) {
@@ -78,11 +81,15 @@
78
81
  mounted.add(i);
79
82
  }
80
83
  for (const index of sort([...mounted])) {
81
- arr.push(index);
84
+ if (index < len) {
85
+ arr.push(index);
86
+ }
82
87
  }
83
88
  } else {
84
89
  for (let i = start; i <= end; i++) {
85
- arr.push(i);
90
+ if (i < len) {
91
+ arr.push(i);
92
+ }
86
93
  }
87
94
  }
88
95
  return arr;
@@ -63,10 +63,15 @@
63
63
  let negative = $derived(stateVersion && scroller.$isNegative());
64
64
 
65
65
  let indexes = $derived.by(() => {
66
+ // https://github.com/inokawa/virtua/pull/847
67
+ const len = data.length;
68
+
66
69
  const [start, end] = range;
67
70
  const arr: number[] = [];
68
71
  for (let i = start; i <= end; i++) {
69
- arr.push(i);
72
+ if (i < len) {
73
+ arr.push(i);
74
+ }
70
75
  }
71
76
  return arr;
72
77
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtua",
3
- "version": "0.48.5",
3
+ "version": "0.48.6",
4
4
  "description": "A zero-config, fast and small (~3kB) virtual list (and grid) component for React, Vue, Solid and Svelte.",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",
@@ -81,7 +81,7 @@
81
81
  "@rollup/plugin-babel": "^6.0.4",
82
82
  "@rollup/plugin-terser": "^0.4.4",
83
83
  "@rollup/plugin-typescript": "^12.0.0",
84
- "@size-limit/preset-small-lib": "^11.2.0",
84
+ "@size-limit/preset-small-lib": "^12.0.0",
85
85
  "@solidjs/testing-library": "^0.8.10",
86
86
  "@storybook/addon-docs": "^10.1.10",
87
87
  "@storybook/addon-vitest": "^10.1.10",
@@ -100,7 +100,6 @@
100
100
  "@vitejs/plugin-react": "^5.0.4",
101
101
  "@vitejs/plugin-vue": "^6.0.1",
102
102
  "@vitejs/plugin-vue-jsx": "^5.1.1",
103
- "@vitest/browser": "^4.0.16",
104
103
  "@vitest/browser-playwright": "^4.0.16",
105
104
  "@vitest/coverage-v8": "^4.0.16",
106
105
  "babel-preset-solid": "^1.9.9",
@@ -128,7 +127,7 @@
128
127
  "rollup": "^4.54.0",
129
128
  "rollup-plugin-banner2": "^1.3.1",
130
129
  "rollup-plugin-copy": "^3.5.0",
131
- "size-limit": "^11.2.0",
130
+ "size-limit": "^12.0.0",
132
131
  "solid-js": "^1.9.9",
133
132
  "storybook": "^10.1.10",
134
133
  "storybook-solidjs-vite": "^10.0.2",