virtua 0.47.0 → 0.47.1
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/README.md +13 -1
- package/lib/core/index.cjs +1 -1
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/solid/index.cjs +1 -1
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +1 -1
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +5 -4
- package/lib/solid/index.jsx.map +1 -1
- package/lib/vue/index.cjs +1 -1
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +1 -1
- package/lib/vue/index.js.map +1 -1
- package/package.json +1 -1
package/lib/solid/index.jsx
CHANGED
|
@@ -305,6 +305,7 @@ const createVirtualStore = (elementsCount, itemSize = 40, ssrCount = 0, cacheSna
|
|
|
305
305
|
let _frozenRange = NULL;
|
|
306
306
|
let _prevRange = [0, isSSR ? max(ssrCount - 1, 0) : -1];
|
|
307
307
|
let _totalMeasuredSize = 0;
|
|
308
|
+
let _isViewportMeasured = false;
|
|
308
309
|
const cache = initCache(elementsCount, cacheSnapshot
|
|
309
310
|
? cacheSnapshot[1]
|
|
310
311
|
: itemSize, cacheSnapshot && cacheSnapshot[0]);
|
|
@@ -348,10 +349,10 @@ const createVirtualStore = (elementsCount, itemSize = 40, ssrCount = 0, cacheSna
|
|
|
348
349
|
return takeCacheSnapshot(cache);
|
|
349
350
|
},
|
|
350
351
|
$getRange: (bufferSize = 200) => {
|
|
351
|
-
if (!
|
|
352
|
-
//
|
|
353
|
-
// We return range for SSR here, or return [0, -1] to render nothing, until the scroll offset and viewport size are determined.
|
|
352
|
+
if (!_isViewportMeasured || isSSR) {
|
|
353
|
+
// Return range for SSR, or return [0, -1] to render nothing, until the scroll offset and viewport size are determined.
|
|
354
354
|
// https://github.com/inokawa/virtua/issues/415
|
|
355
|
+
// https://github.com/inokawa/virtua/pull/818
|
|
355
356
|
return _prevRange;
|
|
356
357
|
}
|
|
357
358
|
let startIndex;
|
|
@@ -523,7 +524,7 @@ const createVirtualStore = (elementsCount, itemSize = 40, ssrCount = 0, cacheSna
|
|
|
523
524
|
case ACTION_VIEWPORT_RESIZE: {
|
|
524
525
|
if (viewportSize !== payload) {
|
|
525
526
|
if (!viewportSize) {
|
|
526
|
-
shouldSync = true;
|
|
527
|
+
_isViewportMeasured = shouldSync = true;
|
|
527
528
|
}
|
|
528
529
|
viewportSize = payload;
|
|
529
530
|
mutated = UPDATE_VIRTUAL_STATE + UPDATE_SIZE_EVENT;
|