Fix ScrollView infinite scroll bug by correcting boundary checks in Fabric implementation#15172
Closed
Fix ScrollView infinite scroll bug by correcting boundary checks in Fabric implementation#15172
Conversation
Copilot
AI
changed the title
[WIP] Bug in Scrollview in 0.80 preview 6
Fix ScrollView infinite scroll bug by correcting boundary checks in Fabric implementation
Sep 23, 2025
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.
The ScrollView component in React Native Windows 0.80 preview 6 was exhibiting infinite scrolling behavior, where users could scroll indefinitely up and down even when content boundaries should have stopped the scrolling. This was a regression from the working behavior in 0.79.
Root Cause
The issue was in the boundary check logic within the Fabric ScrollView implementation (
ScrollViewComponentView.cpp). Three methods had flawed boundary calculations:scrollDown()scrollRight()scrollToEnd()The original problematic logic:
When
m_contentSize.heightwas smaller thanm_layoutMetrics.frame.size.height, the calculation(m_contentSize.height - m_layoutMetrics.frame.size.height)resulted in negative values. This made the boundary check unreliable, especially when scroll positions could also become negative, leading to incorrect boundary detection and infinite scrolling.Solution
The fix implements a two-step boundary check approach:
Changes Made
scrollDown()methodscrollRight()methodscrollToEnd()method with comprehensive boundary checks#include <cmath>forstd::absusageTesting
The fix ensures proper behavior in these scenarios:
This restores the expected ScrollView behavior that worked correctly in React Native Windows 0.79.
Fixes #15171.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Microsoft Reviewers: Open in CodeFlow