Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

onMomentumEnd function not firing in Animated FlashList on Android when using ref.current.scrollToIndex #6605

Open
DOPAgyeman opened this issue Oct 17, 2024 · 0 comments
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@DOPAgyeman
Copy link

DOPAgyeman commented Oct 17, 2024

Description

This issue is still occurring as mentioned by @tomekzaw in a previous issue. The 'onMomentumEnd' function fires with a drag move, but not when scrolling using a ref (e.g ref.current.scrollToIndex)

Is there any workaround for this?

          @tomekzaw I tried your approach, and it does fix the issue only when the scroll is made with a drag move. However, it doesn't trigger when I scroll via `scrollToOffset`.

Originally posted by @hirbod in #3948 (comment)

Steps to reproduce

  • Create an Animated Flash List using Animated.component
  • Add 'useAnimatedScrollHandler' to onScroll of FlashList, and use the 'onMomentumEnd' function
  • Use ref.current.scrollToIndex to programmatically scroll

Snack or a link to a repository

https://snack.expo.dev/@kofiagyeman/onmomentumend-issue

Reanimated version

3.15.0

React Native version

0.74.5

Platforms

Android

@github-actions github-actions bot added Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided and removed Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario labels Oct 17, 2024
@DOPAgyeman DOPAgyeman changed the title onMomentumEnd function not firing in Animated FlashList on Android device onMomentumEnd function not firing in Animated FlashList on Android when using ref.current.scrollToIndex Oct 17, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests

1 participant