Skip to content

Commit 1148c03

Browse files
zhongwuzwfacebook-github-bot
authored andcommitted
Fixes wrong time unit of scroll event throttle (#25098)
Summary: We need to use second for calculation, so change 17ms to 0.017s instead. ## Changelog [iOS] [Fixed] - Fixes wrong time unit of scroll event throttle Pull Request resolved: #25098 Reviewed By: sahrens, cpojer Differential Revision: D15576526 Pulled By: sammy-SC fbshipit-source-id: ddd8dd9098cbe582c6923ce8466892c363c090fc
1 parent 9a053fc commit 1148c03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

React/Views/ScrollView/RCTScrollView.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -706,10 +706,10 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
706706
* warnings, and behave strangely (ListView works fine however), so don't fix it unless you fix that too!
707707
*
708708
* We limit the delta to 17ms so that small throttles intended to enable 60fps updates will not
709-
* inadvertantly filter out any scroll events.
709+
* inadvertently filter out any scroll events.
710710
*/
711711
if (_allowNextScrollNoMatterWhat ||
712-
(_scrollEventThrottle > 0 && _scrollEventThrottle < MAX(17, now - _lastScrollDispatchTime))) {
712+
(_scrollEventThrottle > 0 && _scrollEventThrottle < MAX(0.017, now - _lastScrollDispatchTime))) {
713713

714714
if (_DEPRECATED_sendUpdatedChildFrames) {
715715
// Calculate changed frames

0 commit comments

Comments
 (0)