mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-31 20:33:37 +00:00
54 lines
2.3 KiB
Diff
54 lines
2.3 KiB
Diff
diff --git a/dist/cjs/index.cjs b/dist/cjs/index.cjs
|
|
index 52ae6ca12f8d1c650ee7f1bd55573ee7d4f8b65f..bcee09df7377c37ffb220606b741c9ff434b3470 100644
|
|
--- a/dist/cjs/index.cjs
|
|
+++ b/dist/cjs/index.cjs
|
|
@@ -723,10 +723,12 @@ class Virtualizer {
|
|
this.range = null;
|
|
return null;
|
|
}
|
|
+ const maxScrollOffset = Math.max(this.getTotalSize() - outerSize, 0);
|
|
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset);
|
|
this.range = calculateRangeImpl(
|
|
measurements,
|
|
outerSize,
|
|
- scrollOffset,
|
|
+ effectiveScrollOffset,
|
|
lanes,
|
|
// Pass the typed array so binary search + forward-walk can read
|
|
// start/end directly from Float64Array, skipping the Proxy traps.
|
|
diff --git a/dist/esm/index.js b/dist/esm/index.js
|
|
index 3032c0ca457582be3f47923cba1f7d92c848745c..90b574881a073aabac99c075f7eab0a8f363fff6 100644
|
|
--- a/dist/esm/index.js
|
|
+++ b/dist/esm/index.js
|
|
@@ -721,10 +721,12 @@ class Virtualizer {
|
|
this.range = null;
|
|
return null;
|
|
}
|
|
+ const maxScrollOffset = Math.max(this.getTotalSize() - outerSize, 0);
|
|
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset);
|
|
this.range = calculateRangeImpl(
|
|
measurements,
|
|
outerSize,
|
|
- scrollOffset,
|
|
+ effectiveScrollOffset,
|
|
lanes,
|
|
// Pass the typed array so binary search + forward-walk can read
|
|
// start/end directly from Float64Array, skipping the Proxy traps.
|
|
diff --git a/src/index.ts b/src/index.ts
|
|
index 7ad79aacd591c3a4f7855c91b2727a59a9579bca..faef81e8e567424146143242408eec35a634cf04 100644
|
|
--- a/src/index.ts
|
|
+++ b/src/index.ts
|
|
@@ -1373,10 +1373,12 @@ export class Virtualizer<
|
|
this.range = null
|
|
return null
|
|
}
|
|
+ const maxScrollOffset = Math.max(this.getTotalSize() - outerSize, 0)
|
|
+ const effectiveScrollOffset = Math.min(Math.max(scrollOffset, 0), maxScrollOffset)
|
|
this.range = calculateRangeImpl(
|
|
measurements,
|
|
outerSize,
|
|
- scrollOffset,
|
|
+ effectiveScrollOffset,
|
|
lanes,
|
|
// Pass the typed array so binary search + forward-walk can read
|
|
// start/end directly from Float64Array, skipping the Proxy traps.
|