Skip to content

Commit

Permalink
Fix ScrollView momentum not stopping when calling scrollTo programmat…
Browse files Browse the repository at this point in the history
…ically (#36104)

Summary:
Fixes #32235.

See #32235 (comment) for details.

Before:

https://user-images.githubusercontent.com/20516055/217268275-7ec9a228-bbd6-4294-aa1f-a43c4268984c.mov

After:

https://user-images.githubusercontent.com/20516055/217786242-f44b008f-6c6d-4f11-a7bd-b7a01150f3fb.mov

## Changelog

[ANDROID] [FIXED] - Fixed ScrollView momentum not stopping when calling scrollTo programmatically

Pull Request resolved: #36104

Test Plan: Reproducer: https://github.com/tomekzaw/Issue32235/blob/master/App.tsx

Reviewed By: christophpurrer

Differential Revision: D43153500

Pulled By: cortinico

fbshipit-source-id: ac9c5ed754ed8ba72fe45d506c76f52d795dc83e
  • Loading branch information
tomekzaw authored and facebook-github-bot committed Feb 9, 2023
1 parent d92cb73 commit 681b35d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ public void reactSmoothScrollTo(int x, int y) {
*/
@Override
public void scrollTo(int x, int y) {
mScroller.abortAnimation();
super.scrollTo(x, y);
ReactScrollViewHelper.updateFabricScrollState(this);
setPendingContentOffsets(x, y);
Expand Down

0 comments on commit 681b35d

Please sign in to comment.