Skip to content

Conversation

@johankasperi
Copy link
Contributor

Summary:

This PR adds a new Android-specific boolean property scrollsChildToFocus to the ScrollView component.

When a focusable element inside a ScrollView receives focus (e.g., a TextInput is tapped), Android's default behavior is to automatically scroll the ScrollView to bring that element into view. While this is often desirable, there are cases where developers need more control over scroll behavior - for example, when implementing custom scroll-to-focus animations, when using virtualized lists that manage their own scroll positions, or when focus changes should not disturb the current scroll position.

Setting scrollsChildToFocus={false} disables this automatic scrolling behavior, giving developers full control over scroll positioning when focus changes.

Related issues:

Changelog:

[ANDROID] [ADDED] - Add scrollsChildToFocus prop to ScrollView to control automatic scrolling when a child receives focus

Test Plan:

  1. Run the RN Tester app on Android
  2. Navigate to ScrollView examples
  3. Find the new "scrollsChildToFocus" example in the Android-specific section
  4. With scrollsChildToFocus: true (default):
    • Tap on a TextInput that is partially visible
    • Observe that the ScrollView automatically scrolls to bring the TextInput into view
  5. Toggle scrollsChildToFocus to false:
    • Tap on a TextInput that is partially visible
    • Observe that the ScrollView does NOT automatically scroll - the focus changes but scroll position remains unchanged

This property affects both vertical (<ScrollView />) and horizontal (<ScrollView horizontal={true} />) scroll views.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 13, 2026
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants