Skip to content

fix: flex scrollable size does not count gap#860

Merged
andycall merged 2 commits intomainfrom
fix/flex-size-did-not-count-gap
Feb 14, 2026
Merged

fix: flex scrollable size does not count gap#860
andycall merged 2 commits intomainfrom
fix/flex-size-did-not-count-gap

Conversation

@CGQAQ
Copy link
Contributor

@CGQAQ CGQAQ commented Feb 13, 2026

Summary

  • Fix _setMaxScrollableSize() in flex layout to include main-axis gap between items and cross-axis gap between flex lines when computing the scrollable overflow area
  • Ensure each child's scrollable extent covers at least its border-box size (child.scrollableSize only covers padding-box and can underestimate)
  • Fix test timing: use waitForFrame() before/after setting scrollLeft/scrollTop so the scroll controller has clients and the paint takes effect before snapshot capture

Test plan

  • All 6 flex-gap-sizing regression tests pass (row/column × 3items/4items/large-gap)
  • All 18 existing flex-gap tests pass (no regressions)
  • Verified tests fail without the Dart fix (6/6 failures)
  • Snapshots show last item fully visible when scrolled to the end

🤖 Generated with Claude Code

CGQAQ and others added 2 commits February 13, 2026 12:04
…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>
@vercel
Copy link

vercel bot commented Feb 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
use-case Ready Ready Preview, Comment Feb 13, 2026 5:29am
vue_usecase Ready Ready Preview, Comment Feb 13, 2026 5:29am

Request Review

@CGQAQ CGQAQ requested a review from andycall February 13, 2026 05:34
@andycall andycall merged commit 76d0588 into main Feb 14, 2026
31 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants