Skip to content

[Android] ScrollView momentum not stopping when calling scrollTo programmatically #32235

@chr-sk

Description

@chr-sk

Description

When scrolling down a long ScrollView or FlatList on Android and calling scrollTo programmatically while the ScrollView's momentum is still going, the momentum does not stop and the resulting scrolling is stuttering and simply wrong.

React Native version / Platform

0.65.1 / Android

With 0.63.4, this bug was not yet present.

Steps To Reproduce

  1. Render a ScrollView (or FlatList) with long content and a button with onPress={() => scrollViewRef.scrollTo({ y: 0, animated: true })}.
  2. Scroll quickly down with your finger so that a momentum occurs.
  3. Press the button while the momentum is still going.

Expected Results

The momentum should stop and the ScrollView should scroll to its beginning.

Possible reason

It seems that the reason for this bug lies in the following commit: 10314fe

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions