Skip to content

fix(scrollview): honor programmatic scrollTo when scrollEnabled={false}#16304

Draft
FaithfulAudio wants to merge 2 commits into
microsoft:0.83-stablefrom
FacilitronWorks:fix/scrollview-programmatic-scroll-disabled
Draft

fix(scrollview): honor programmatic scrollTo when scrollEnabled={false}#16304
FaithfulAudio wants to merge 2 commits into
microsoft:0.83-stablefrom
FacilitronWorks:fix/scrollview-programmatic-scroll-disabled

Conversation

@FaithfulAudio

@FaithfulAudio FaithfulAudio commented Jul 11, 2026

Copy link
Copy Markdown

Problem

On a ScrollView/FlatList with scrollEnabled={false}, imperative scrollTo / scrollToOffset / scrollToIndex do nothing on RNW. On iOS/Android, scrollEnabled blocks only user gestures — programmatic scrolls still apply.

Root cause

ScrollViewComponentView::scrollTo() early-returns when scrollEnabled is false. scrollToIndex/scrollToOffset route through the scrollTo command, so all imperative scrolls are dropped.

Fix

Remove the early-return. User-gesture scrolling remains gated by m_scrollVisual.ScrollEnabled(...) (set from scrollEnabled in updateProps), 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 ignores scrollTo({y:500, animated:false}) — the call fires, no scroll event is emitted, content stays at Row 0. The probe renders its own status line:

scrollTo fired, did not move

Expected after-state per the diff: TryUpdatePosition applies the offset and onScroll reports y=500. Needs upstream CI + the same probe on a framework source build.

Intentionally not touched: StartBringIntoView() and scrollToEnd()/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 against 0.83-stable; happy to re-cut onto main.

Microsoft Reviewers: Open in CodeFlow

FaithfulAudio and others added 2 commits July 11, 2026 11:58
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>
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@FaithfulAudio

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree [company="Facilitron"]

@FaithfulAudio

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Facilitron"

@FaithfulAudio

Copy link
Copy Markdown
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: scrollTo({y:500}) on a scrollEnabled={false} ScrollView now applies — status line reads "onScroll y: 500" with the y=500 row at viewport top (previously "none", content parked at Row 0).

Before: before
After: after

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.

1 participant