fix(app): avoid invalid continue in virtua patch

This commit is contained in:
LukeParkerDev 2026-05-20 17:34:52 +10:00
parent 23320a199e
commit ef30c3777a

View file

@ -57,18 +57,21 @@ index 029201a2c8..e3c4c0ca3a 100644
@@ -1430,5 +1449,7 @@ const Virtualizer = (props) => {
else {
for (let [i, j] = range(); i <= j; i++) {
+ if (i < 0 || i >= count)
+ continue;
items.push(props.data[i]);
indexes.push(i);
+ if (i >= 0 && i < count) {
- items.push(props.data[i]);
- indexes.push(i);
+ items.push(props.data[i]);
+ indexes.push(i);
+ }
}
@@ -1579,6 +1600,8 @@ const VList = (props) => {
});
const items = [];
for (let [i, j] = range(); i <= j; i++) {
+ if (i < 0 || i >= count)
+ continue;
items.push(props.data[i]);
+ if (i >= 0 && i < count) {
- items.push(props.data[i]);
+ items.push(props.data[i]);
+ }
}
return items;
diff --git a/lib/solid/Virtualizer.d.ts b/lib/solid/Virtualizer.d.ts