Skip to content

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

Open
FaithfulAudio wants to merge 1 commit into
microsoft:mainfrom
FacilitronWorks:fix/scrollto-scrollenabled-main
Open

fix(scrollview): honor programmatic scrollTo when scrollEnabled={false}#16336
FaithfulAudio wants to merge 1 commit into
microsoft:mainfrom
FacilitronWorks:fix/scrollto-scrollenabled-main

Conversation

@FaithfulAudio

@FaithfulAudio FaithfulAudio commented Jul 26, 2026

Copy link
Copy Markdown

Problem

scrollTo (and scrollToIndex / scrollToOffset, which route through it) is silently dropped when scrollEnabled={false} — the command hits an early return in ScrollViewComponentView::scrollTo and nothing happens.

On iOS and Android, scrollEnabled={false} only disables user scroll gestures; programmatic scrolls still work. Common patterns that rely on this — a paged carousel driven by buttons, a chat view pinned to bottom on new messages while user scrolling is locked, a tab strip synced to a PagerView — work on the other platforms and no-op on Windows.

Root cause

void ScrollViewComponentView::scrollTo(winrt::Windows::Foundation::Numerics::float3 offset, bool animate) noexcept {
  if (!std::static_pointer_cast<const facebook::react::ScrollViewProps>(viewProps())->scrollEnabled) {
    return;
  }
  m_scrollVisual.TryUpdatePosition(offset, animate);
}

The gate is redundant for its apparent purpose: user-gesture input is already gated separately via m_scrollVisual.ScrollEnabled, set from scrollEnabled in updateProps. So removing this check re-enables nothing for the user — it only lets the programmatic path through.

Fix

Remove the early return; always honor a programmatic scroll. One file, no header or API change.

Validation

  • Verified in a production RNW 0.83.2 new-arch app (Facilitron FIT), compiled from source, where the same change (as fix(scrollview): honor programmatic scrollTo when scrollEnabled={false} #16304) fixed button-driven scrolling of a locked list; user gestures remained disabled.
  • Not verified on this branch: no CI has run (gated behind a maintainer /azp run), and I have not built main with this change. The diff is context-identical to the 0.83-stable version apart from surrounding-code drift.

Caveats for reviewers:

🤖 Generated with Claude Code

Microsoft Reviewers: Open in CodeFlow

scrollEnabled={false} must only disable user scroll gestures, matching iOS and
Android where setContentOffset / scrollToOffset still work when scrolling is
disabled. The scrollTo command (and scrollToIndex / scrollToOffset, which route
through it) previously hit a scrollEnabled early-return and was silently
dropped. User-gesture input is gated separately via m_scrollVisual.ScrollEnabled
(set from scrollEnabled in updateProps), so honoring a programmatic scroll here
does not re-enable user scrolling.

main-branch twin of microsoft#16304 (0.83-stable).
@FaithfulAudio
FaithfulAudio requested a review from a team as a code owner July 26, 2026 07:03
@azure-pipelines

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

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