Repository navigation
Avoid populating cached bounds when fixed itemSize is zero - #923
Merged
bvaughn merged 2 commits intoOct 18, 2026
Merged
Conversation
|
@feritcemkahraman is attempting to deploy a commit to the Brian Vaughn's projects Team on Vercel. A member of the Team first needs to authorize it. |
…izes - createCachedBounds: fixed numeric sizes return computed bounds instead of memoizing one Map entry per lookup. - getStartStopIndices: any fixed size takes the O(1) branch; zero, negative or NaN sizes render only the first item (previously offset 0 rendered the last rows, and negative offsets mounted every row). - useItemSize: normalize NaN/negative/non-finite sizes (e.g. "abc%") to 0 so estimated size is never NaN.
bvaughn
approved these changes
Oct 18, 2026
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cachedBounds.itemSizeis a fixed numeric size of0(for example, before a percentage-sized container's initial measurement),getStartStopIndicespreviously fell through to the variable-size path and walkedcachedBounds.get(index)across allitemCountitems, populating up tocachedBounds.itemSize === 0incachedBounds, preserving the exact visible/overscan start and stop indices of the linear lookup across negative, zero, and positive scroll offsets.Testing
npx prettier --check lib/core/getStartStopIndices.ts lib/core/getStartStopIndices.test.tsnpx eslint lib/core/getStartStopIndices.ts lib/core/getStartStopIndices.test.tsTARGET=lib npx vite buildnpx vitest run lib --maxWorkers=1(22 test files, 208 tests passed)integrations/*workspace packages and Playwright e2e integration suites were not installed/run locally.