Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Honor programmatic scrollTo when scrollEnabled=false (gestures remain blocked), matching iOS/Android semantics",
"packageName": "react-native-windows",
"email": "collindanielschneide@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1179,10 +1179,13 @@ void ScrollViewComponentView::HandleCommand(const winrt::Microsoft::ReactNative:
}

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

// scrollEnabled={false} must only disable *user* scroll gestures, matching
// iOS and Android where setContentOffset / scrollToOffset still work when
// scrolling is disabled. Programmatic scrolls - the scrollTo command, and
// scrollToIndex / scrollToOffset which route through it - previously hit a
// scrollEnabled early-return here and were silently dropped. User-gesture input
// is gated separately (m_scrollVisual.ScrollEnabled, set from scrollEnabled in
// updateProps), so it is safe to always honor a programmatic scroll here.
m_scrollVisual.TryUpdatePosition(offset, animate);
}

Expand Down