The problem
When using FlatList's onScroll property it never triggers on Web, but triggers on Android and iOS. Even when setting scrollEventThrottle to 16 still never causes it to trigger.
How to reproduce
Simplified test case: https://snack.expo.io/GWLY9XaUD
Steps to reproduce:
Expected behavior
When scrolling the onScroll callback for FlatList should be invoked.
Environment (include versions). Did this work in previous versions?
Using Expo for both Android/iOS and Web
It's working fine https://codesandbox.io/s/peaceful-hamilton-s2k1i
Thanks, sorry about that I assumed the expo snack would display the same behavior. This leads me to believe the issue is with Expo then :+1:
Probably works fine there too. The value you're using to update state probably isn't changing on scroll
I don't believe so, comparing https://codesandbox.io/s/funny-ptolemy-9mi1n versus https://snack.expo.io/@nickhackman/flatlist-simple same code different host provider when scrolling yields a different result, at least on Linux Chrome 87. The value does change when scrolling as expected on codesandbox, but not on Expo web.
I've got the same issue with an expo bare project apparently and if I copy-paste the working example above from codesandbox to expo snack, it doesn't log on scroll on web (it logs correctly on native devices though).
I tried different expo, react, react-native and react-native-web versions, but I couldn't pinpoint the issue.
I keep investigating...
Did anyone manage to resolve this issue?
@necolas I have setup an app using create-react-app and only copied the code from codesandbox (no other change)
https://github.com/vishalnarkhede/rnw-flatlist-example
onScroll handler never gets called for some reason. On codesandbox it seems to work fine. Any hints?
You haven't looked at the index.html root elements styles. This is documented and has been covered many times
@necolas Thanks a ton for quick response!! Indeed I missed that part, my bad. Cheers ;)