fix: flex scrollable size does not count gap#860
Merged
Conversation
…l size Flex containers with gap and overflow scroll calculate scrollWidth/scrollHeight without including gap space, causing the last item to be clipped by exactly the total gap length when scrolling to the end. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
_setMaxScrollableSize() was not accounting for main-axis gap between items or cross-axis gap between flex lines, and child.scrollableSize (padding-box) could be smaller than the border-box. This caused scrollWidth/scrollHeight to be underestimated, clipping the last item when scrolling to the end of an overflowing flex container with gap. Also fix test timing: use waitForFrame() before/after setting scrollLeft/scrollTop so the scroll controller has clients and the paint takes effect before snapshot capture. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
andycall
approved these changes
Feb 14, 2026
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
_setMaxScrollableSize()in flex layout to include main-axis gap between items and cross-axis gap between flex lines when computing the scrollable overflow areawaitForFrame()before/after settingscrollLeft/scrollTopso the scroll controller has clients and the paint takes effect before snapshot captureTest plan
flex-gap-sizingregression tests pass (row/column × 3items/4items/large-gap)flex-gaptests pass (no regressions)🤖 Generated with Claude Code