Open scrungrth opened 4 months ago
:warning: | Newer Version of React Native is Available! |
---|---|
:information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.73.7. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
I have debugged this and here are my observations
scrollEventThrottle
throttles all scroll events which includes onScroll
, onScrollEndDrag
, onScrollMomentumBegin
, onMomentumScrollEnd
etc.lastScrollDispatchTime
is set in ReactScrollView
. Before firing next event a condition is checked if scrollEventThrottle
> currentTimeStamp - lastScrollDispatchTime
.onScroll
event was getting fired with above condition as false and hence a lastDispatchTimestamp
is set to currentTimeStamp
, any event coming after this gets throttled in this case it was onScrollEndDrag
I think this behaviour is by design as per the documentation. @cortinico can clarify more on this.
@kunalchavhan that's some great insight;
I think this behaviour is by design as per the documentation.
It seems strange to me that one time per-scroll type of events would be throttled here though even if there was a shared event throttle.
Same issue after upgrading from 0.72.4 -> 0.74.1
Description
on android, onScrollEndDrag can be prevented by a non-zero scrollEventThrottle value.
Steps to reproduce
onScrollEndDrag
message is not logged.onScrollEndDrag
message is logged.React Native Version
0.73.6
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/scrungrth/android-scroll-throttle-reproducer
Screenshots and Videos
No response