fix(scrollview): honor programmatic scrollTo when scrollEnabled={false}#16336
Open
FaithfulAudio wants to merge 1 commit into
Open
fix(scrollview): honor programmatic scrollTo when scrollEnabled={false}#16336FaithfulAudio wants to merge 1 commit into
FaithfulAudio wants to merge 1 commit into
Conversation
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).
Contributor
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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
scrollTo(andscrollToIndex/scrollToOffset, which route through it) is silently dropped whenscrollEnabled={false}— the command hits an early return inScrollViewComponentView::scrollToand 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
The gate is redundant for its apparent purpose: user-gesture input is already gated separately via
m_scrollVisual.ScrollEnabled, set fromscrollEnabledinupdateProps. 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
/azp run), and I have not builtmainwith this change. The diff is context-identical to the 0.83-stable version apart from surrounding-code drift.Caveats for reviewers:
maintwin of fix(scrollview): honor programmatic scrollTo when scrollEnabled={false} #16304 (0.83-stable), per the convention requested on fix(textinput): correct placeholder layout constraints (px vs DIP) and no-op NaN fontSize guard #16303 (its twin is fix(textinput): correct placeholder layout constraints (px vs DIP) and no-op NaN fontSize guard #16317).type: prereleaseto match main-line convention; happy to adjust.🤖 Generated with Claude Code
Microsoft Reviewers: Open in CodeFlow