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.

@acoates-ms

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 1 pipeline(s).

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Performance Test Results

Branch: fix/scrollto-scrollenabled-main
Commit: eb51a150
Time: 2026-08-03T22:59:35.438Z
Tests: 161/161 passed

✅ Passed

161 scenario(s) across 28 suite(s) — no regressions

SectionList

Scenario Mean Median StdDev Renders vs Baseline
SectionList mount 2.90ms 3.00ms ±0.74ms 1 -40.0%
SectionList unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
SectionList rerender 6.70ms 7.00ms ±1.06ms 2 -33.3%
SectionList with-3-sections-15-items 3.60ms 3.00ms ±0.84ms 1 -45.5%
SectionList with-5-sections-50-items 3.50ms 3.00ms ±0.97ms 1 -50.0%
SectionList with-10-sections-200-items 3.00ms 3.00ms ±0.47ms 1 -45.5%
SectionList with-20-sections-200-items 3.20ms 3.00ms ±1.40ms 1 -40.0%
SectionList with-section-separator 1.10ms 1.00ms ±0.32ms 1 -50.0%
SectionList with-item-separator 1.20ms 1.00ms ±0.63ms 1 -50.0%
SectionList with-header-footer 1.00ms 1.00ms ±0.00ms 1 -50.0%
SectionList with-section-footer 1.40ms 1.00ms ±1.35ms 1 -50.0%
SectionList with-sticky-section-headers 1.20ms 1.00ms ±0.42ms 1 -50.0%
SectionList with-empty-list 0.30ms 0.00ms ±0.48ms 1 -100.0%
SectionList with-50-sections-1000-items 1.00ms 1.00ms ±0.00ms 1 -50.0%

FlatList

Scenario Mean Median StdDev Renders vs Baseline
FlatList mount 2.70ms 3.00ms ±0.48ms 1 -25.0%
FlatList unmount 0.40ms 0.00ms ±0.52ms 0 +0.0%
FlatList rerender 6.60ms 6.00ms ±1.51ms 2 -33.3%
FlatList with-10-items 3.10ms 3.00ms ±0.32ms 1 -25.0%
FlatList with-100-items 2.90ms 3.00ms ±0.57ms 1 -40.0%
FlatList with-500-items 2.60ms 3.00ms ±0.52ms 1 -25.0%
FlatList with-1000-items 2.80ms 3.00ms ±0.92ms 1 -25.0%
FlatList horizontal 2.40ms 2.50ms ±0.70ms 1 -50.0%
FlatList with-separator 1.50ms 1.00ms ±1.27ms 1 -50.0%
FlatList with-header-footer 1.00ms 1.00ms ±0.00ms 1 -50.0%
FlatList with-empty-list 0.20ms 0.00ms ±0.42ms 1 -100.0%
FlatList with-get-item-layout 1.00ms 1.00ms ±0.00ms 1 +0.0%
FlatList inverted 1.20ms 1.00ms ±1.40ms 1 -33.3%
FlatList with-num-columns 1.20ms 1.00ms ±0.42ms 1 -66.7%

TouchableOpacity

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity mount 0.60ms 1.00ms ±0.52ms 1 +0.0%
TouchableOpacity unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TouchableOpacity rerender 0.80ms 1.00ms ±0.92ms 2 +0.0%
TouchableOpacity custom-active-opacity 0.40ms 0.00ms ±0.52ms 1 -100.0%
TouchableOpacity disabled 0.50ms 0.50ms ±0.53ms 1 -50.0%
TouchableOpacity with-all-handlers 0.20ms 0.00ms ±0.42ms 1 -100.0%
TouchableOpacity with-hit-slop 0.70ms 1.00ms ±0.48ms 1 +0.0%
TouchableOpacity with-delay 0.50ms 0.50ms ±0.53ms 1 -50.0%
TouchableOpacity nested 0.70ms 1.00ms ±0.67ms 1 +0.0%
TouchableOpacity multiple-10 3.67ms 3.00ms ±1.76ms 1 -50.0%
TouchableOpacity multiple-50 15.07ms 14.00ms ±1.98ms 1 -51.7%
TouchableOpacity multiple-100 12.00ms 11.00ms ±2.56ms 1 -78.0%

ScrollView

Scenario Mean Median StdDev Renders vs Baseline
ScrollView mount 0.30ms 0.00ms ±0.48ms 1 +0.0%
ScrollView unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
ScrollView rerender 0.80ms 1.00ms ±0.92ms 2 +0.0%
ScrollView children-20 1.93ms 2.00ms ±0.26ms 1 -50.0%
ScrollView children-100 9.87ms 10.00ms ±1.41ms 1 -37.5%
ScrollView horizontal 2.20ms 2.00ms ±0.42ms 1 -50.0%
ScrollView sticky-headers 2.10ms 2.00ms ±1.10ms 1 -33.3%
ScrollView scroll-indicators 0.50ms 0.50ms ±0.53ms 1 -50.0%
ScrollView nested 0.90ms 1.00ms ±0.88ms 1 +0.0%
ScrollView content-container-style 0.40ms 0.00ms ±0.52ms 1 -100.0%
ScrollView children-500 11.33ms 11.00ms ±2.02ms 1 -42.1%

TouchableHighlight

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight mount 0.20ms 0.00ms ±0.42ms 1 -100.0%
TouchableHighlight unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TouchableHighlight rerender 0.50ms 0.50ms ±0.53ms 2 -50.0%
TouchableHighlight custom-underlay-color 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight custom-active-opacity 0.10ms 0.00ms ±0.32ms 1 +0.0%
TouchableHighlight disabled 0.10ms 0.00ms ±0.32ms 1 +0.0%
TouchableHighlight with-all-handlers 0.20ms 0.00ms ±0.42ms 1 +0.0%
TouchableHighlight with-hit-slop 0.20ms 0.00ms ±0.42ms 1 +0.0%
TouchableHighlight nested-touchables 0.60ms 1.00ms ±0.52ms 1 +0.0%
TouchableHighlight multiple-touchables-10 1.70ms 2.00ms ±0.48ms 1 -33.3%
TouchableHighlight multiple-touchables-50 7.90ms 8.00ms ±0.57ms 1 -36.0%
TouchableHighlight multiple-touchables-100 14.70ms 15.00ms ±2.67ms 1 -33.3%

Pressable

Scenario Mean Median StdDev Renders vs Baseline
Pressable mount 0.30ms 0.00ms ±0.48ms 1 +0.0%
Pressable unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Pressable rerender 0.30ms 0.00ms ±0.48ms 2 -100.0%
Pressable with-all-handlers 0.10ms 0.00ms ±0.32ms 1 +0.0%
Pressable with-style-function 0.20ms 0.00ms ±0.42ms 1 +0.0%
Pressable disabled 0.20ms 0.00ms ±0.42ms 1 +0.0%
Pressable with-hit-slop 0.10ms 0.00ms ±0.32ms 1 +0.0%
Pressable nested 0.40ms 0.00ms ±0.52ms 1 -100.0%
Pressable multiple-10 1.80ms 2.00ms ±0.41ms 1 -33.3%
Pressable multiple-50 9.27ms 9.00ms ±1.39ms 1 -35.7%
Pressable multiple-100 9.93ms 7.00ms ±6.76ms 1 -41.7%

Modal

Scenario Mean Median StdDev Renders vs Baseline
Modal mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Modal rerender 0.70ms 0.00ms ±1.25ms 2 +0.0%
Modal slide-animation 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal fade-animation 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal transparent 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal with-callbacks 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal rich-content 1.00ms 1.00ms ±0.00ms 1 -50.0%
Modal with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%

Image

Scenario Mean Median StdDev Renders vs Baseline
Image mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Image rerender 0.10ms 0.00ms ±0.32ms 2 +0.0%
Image with-resize-mode 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-border-radius 0.00ms 0.00ms ±0.00ms 1 +0.0%
Image with-tint-color 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-blur-radius 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-accessibility 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image multiple-10 0.53ms 1.00ms ±0.52ms 1 +0.0%
Image multiple-50 2.40ms 2.00ms ±0.63ms 1 -33.3%
Image multiple-100 5.20ms 5.00ms ±0.86ms 1 -37.5%

ActivityIndicator

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
ActivityIndicator rerender 0.00ms 0.00ms ±0.00ms 2 +0.0%
ActivityIndicator size-large 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator size-small 0.00ms 0.00ms ±0.00ms 1 +0.0%
ActivityIndicator with-color 0.00ms 0.00ms ±0.00ms 1 +0.0%
ActivityIndicator not-animating 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator with-accessibility 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator multiple-10 0.60ms 1.00ms ±0.51ms 1 +0.0%
ActivityIndicator multiple-50 2.53ms 2.00ms ±0.92ms 1 -50.0%
ActivityIndicator multiple-100 5.40ms 5.00ms ±0.83ms 1 -28.6%

Switch

Scenario Mean Median StdDev Renders vs Baseline
Switch mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
Switch unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
Switch rerender 0.10ms 0.00ms ±0.32ms 2 -100.0%
Switch value-true 0.10ms 0.00ms ±0.32ms 1 +0.0%
Switch disabled 0.10ms 0.00ms ±0.32ms 1 +0.0%
Switch custom-colors 0.10ms 0.00ms ±0.32ms 1 +0.0%
Switch on-value-change 0.10ms 0.00ms ±0.32ms 1 +0.0%
Switch with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch multiple-10 1.07ms 1.00ms ±0.26ms 1 -50.0%
Switch multiple-50 5.27ms 4.00ms ±2.09ms 1 -55.6%
Switch multiple-100 11.07ms 11.00ms ±2.25ms 1 -31.3%

Button

Scenario Mean Median StdDev Renders vs Baseline
Button mount 0.30ms 0.00ms ±0.48ms 1 -100.0%
Button unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Button rerender 0.80ms 1.00ms ±0.42ms 2 +0.0%
Button disabled 0.40ms 0.00ms ±0.52ms 1 -100.0%
Button with-color 0.40ms 0.00ms ±0.52ms 1 -100.0%
Button with-accessibility 0.40ms 0.00ms ±0.52ms 1 -100.0%
Button multiple-10 3.67ms 3.00ms ±0.90ms 1 -50.0%
Button multiple-50 12.80ms 15.00ms ±5.29ms 1 -44.4%
Button multiple-100 8.00ms 8.00ms ±2.10ms 1 -57.9%

TextInput

Scenario Mean Median StdDev Renders vs Baseline
TextInput mount 0.00ms 0.00ms ±0.00ms 1 +0.0%
TextInput unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TextInput rerender 0.20ms 0.00ms ±0.42ms 2 +0.0%
TextInput multiline 0.00ms 0.00ms ±0.00ms 1 +0.0%
TextInput with-value 0.10ms 0.00ms ±0.32ms 1 +0.0%
TextInput styled 0.10ms 0.00ms ±0.32ms 1 +0.0%
TextInput multiple-100 4.87ms 5.00ms ±0.83ms 1 -28.6%

View

Scenario Mean Median StdDev Renders vs Baseline
View mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
View unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
View rerender 0.10ms 0.00ms ±0.32ms 2 +0.0%
View nested-50 2.40ms 2.00ms ±0.91ms 1 -33.3%
View nested-100 4.80ms 5.00ms ±0.68ms 1 -28.6%
View shadow 0.10ms 0.00ms ±0.32ms 1 +0.0%
View border-radius 0.10ms 0.00ms ±0.32ms 1 +0.0%
View nested-500 10.27ms 6.00ms ±9.41ms 1 -40.0%

Text

Scenario Mean Median StdDev Renders vs Baseline
Text mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Text rerender 0.00ms 0.00ms ±0.00ms 2 +0.0%
Text long-1000 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text nested 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text styled 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text multiple-100 5.20ms 5.00ms ±0.77ms 1 -28.6%

SectionList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
SectionList native mount 2.89ms 2.78ms ±0.26ms 1 -57.2%

FlatList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
FlatList native mount 3.09ms 2.95ms ±0.49ms 1 -68.0%

TouchableHighlight.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight native mount 0.99ms 0.96ms ±0.09ms 1 -53.9%

TouchableOpacity.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity native mount 1.16ms 1.15ms ±0.10ms 1 -63.5%

Pressable.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Pressable native mount 1.05ms 1.04ms ±0.11ms 1 -58.4%

ScrollView.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ScrollView native mount 2.37ms 2.32ms ±0.41ms 1 -42.7%

ActivityIndicator.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator native mount 0.83ms 0.83ms ±0.07ms 1 -66.6%

TextInput.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TextInput native mount 1.48ms 1.46ms ±0.17ms 1 -64.4%

Switch.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Switch native mount 0.80ms 0.76ms ±0.10ms 1 -56.0%

Button.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Button native mount 1.25ms 1.15ms ±0.29ms 1 -55.9%

Modal.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Modal native mount 0.57ms 0.56ms ±0.04ms 1 -53.8%

Image.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Image native mount 1.30ms 1.25ms ±0.24ms 1 -44.7%

View.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
View native mount 0.68ms 0.68ms ±0.07ms 1 -52.5%

Text.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Text native mount 0.93ms 0.88ms ±0.17ms 1 -49.2%

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.

2 participants