fix(scrollview): honor programmatic scrollTo when scrollEnabled={false}#16304
Draft
FaithfulAudio wants to merge 2 commits into
Draft
fix(scrollview): honor programmatic scrollTo when scrollEnabled={false}#16304FaithfulAudio wants to merge 2 commits into
FaithfulAudio wants to merge 2 commits into
Conversation
ScrollViewComponentView::scrollTo() early-returned whenever scrollEnabled was false, so scrollTo (and scrollToIndex / scrollToOffset, which route through the "scrollTo" command) were dropped on a non-scrollable ScrollView / FlatList. On iOS and Android scrollEnabled only blocks user pan gestures; programmatic scroll offsets still apply. Remove the early-return; user-gesture scrolling remains gated by m_scrollVisual.ScrollEnabled (set from scrollEnabled in updateProps). Note: StartBringIntoView() and scrollToEnd()/scrollToStart() keep an analogous scrollEnabled gate; those also serve keyboard/focus paths and are left for separate discussion so keyboard scroll semantics aren't changed here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@microsoft-github-policy-service agree [company="Facilitron"] |
Author
|
@microsoft-github-policy-service agree company="Facilitron" |
This was referenced Jul 11, 2026
Author
|
Validated end-to-end on a patched framework source build. We compiled this fix into Microsoft.ReactNative from source (yarn-patch, RNW 0.83.2, ARM64 Debug; patched dll verified as the loaded module via GetDeviceCaps/GDI32 import markers vs the stock NuGet dll as negative control) and re-ran the same probe in our production app: |
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.


Problem
On a
ScrollView/FlatListwithscrollEnabled={false}, imperativescrollTo/scrollToOffset/scrollToIndexdo nothing on RNW. On iOS/Android,scrollEnabledblocks only user gestures — programmatic scrolls still apply.Root cause
ScrollViewComponentView::scrollTo()early-returns whenscrollEnabledis false.scrollToIndex/scrollToOffsetroute through thescrollTocommand, so all imperative scrolls are dropped.Fix
Remove the early-return. User-gesture scrolling remains gated by
m_scrollVisual.ScrollEnabled(...)(set fromscrollEnabledinupdateProps), so this only re-enables programmatic scrolls — matching iOS/Android semantics.Validation
Bug reproduced in a production RNW 0.83.2 new-arch app (Facilitron FIT, Windows 11 ARM64, Debug, 250% scale): a
scrollEnabled={false}ScrollView with 800-DIP content in a 110-DIP viewport ignoresscrollTo({y:500, animated:false})— the call fires, no scroll event is emitted, content stays at Row 0. The probe renders its own status line:Expected after-state per the diff:
TryUpdatePositionapplies the offset andonScrollreports y=500. Needs upstream CI + the same probe on a framework source build.Intentionally not touched:
StartBringIntoView()andscrollToEnd()/scrollToStart()carry an analogous gate but also serve keyboard/focus paths — changing those would alter keyboard-scroll semantics, so they're flagged for maintainer discussion instead. Authored against0.83-stable; happy to re-cut ontomain.Microsoft Reviewers: Open in CodeFlow