Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Native Animated Event issues #10021

Closed
nihgwu opened this issue Sep 21, 2016 · 9 comments
Closed

Native Animated Event issues #10021

nihgwu opened this issue Sep 21, 2016 · 9 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@nihgwu
Copy link
Contributor

nihgwu commented Sep 21, 2016

I've found some issues with the Native Animated Event

  1. If I hold a touchable view in the scrollview, then stop scrolling, when I release the touch, the onPress of the touchable view is fired, that makes Native Animated Event almost unavailable in real use case.
  2. 'Native Animated Event' will made onScroll related events such as onEndReached unavailable in ListView, because the onScroll won't be called at all when turn on useNativeDriver, that breaks the common use case of ListView too.

I'm wondering is there any workaround for those issues, as I really need this Native Animated Event feature to improve the performance of my app. @janicduplessis

@leeight
Copy link
Contributor

leeight commented Sep 21, 2016

+1

@ramilushev
Copy link

ramilushev commented Nov 10, 2016

I'm experiencing this on 0.36. Native animation works fine, but onEndReached is never called.

@nihgwu Did you manage to find a fix or a workaround?

@janicduplessis This is a big deal I think ..

Edit: Forgot to mention I'm seeing this on Android, have not tested iOS

@nihgwu
Copy link
Contributor Author

nihgwu commented Nov 10, 2016

@ramilushev This issue should be on both platforms and I don't know how to fix it, still waiting for @janicduplessis 😔

@janicduplessis
Copy link
Contributor

The problem is that we don't send the event to JS if it is handled natively. I suggest removing this and always send the event.

See https://github.com/facebook/react-native/blob/master/React/Base/RCTEventDispatcher.m#L149 and https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/EventDispatcher.java#L117

We should also change the EventListener interfaces so they don't return a bool anymore. Let me know if one of you would like to send a PR, if not I'll try to work on this soon.

@AlbertBrand
Copy link
Contributor

This is solved in RN 0.40 by #10981 right?

@nihgwu
Copy link
Contributor Author

nihgwu commented Dec 22, 2016

@AlbertBrand thanks for reminding, closing it.

@nihgwu nihgwu closed this as completed Dec 22, 2016
@ramilushev
Copy link

This is still an issue for me, I am using RN v0.43.2

I pass the renderScrollComponent prop to ListView and render an Animated.ScrollView as a scroll component which has an Animated.event() for onScroll

The onScroll event is still not propagated and events such as onEndReached are never called.

@nihgwu could you share an example of how you got it to work? Thanks.

@lezin
Copy link

lezin commented Apr 17, 2017

I have the same problem, @nihgwu could you share an example?

@nihgwu
Copy link
Contributor Author

nihgwu commented Apr 17, 2017

const AnimatedListView = Animated.createAnimatedComponent(ListView)
no need to define renderScrollComponent

@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants