From 1148c03f6f51329710e23fba99a6916fff3ba42c Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Mon, 3 Jun 2019 01:49:51 -0700 Subject: [PATCH] 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: https://github.com/facebook/react-native/pull/25098 Reviewed By: sahrens, cpojer Differential Revision: D15576526 Pulled By: sammy-SC fbshipit-source-id: ddd8dd9098cbe582c6923ce8466892c363c090fc --- React/Views/ScrollView/RCTScrollView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/React/Views/ScrollView/RCTScrollView.m b/React/Views/ScrollView/RCTScrollView.m index 7e73924379f80b..0e0b882a02c826 100644 --- a/React/Views/ScrollView/RCTScrollView.m +++ b/React/Views/ScrollView/RCTScrollView.m @@ -706,10 +706,10 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView * warnings, and behave strangely (ListView works fine however), so don't fix it unless you fix that too! * * We limit the delta to 17ms so that small throttles intended to enable 60fps updates will not - * inadvertantly filter out any scroll events. + * inadvertently filter out any scroll events. */ if (_allowNextScrollNoMatterWhat || - (_scrollEventThrottle > 0 && _scrollEventThrottle < MAX(17, now - _lastScrollDispatchTime))) { + (_scrollEventThrottle > 0 && _scrollEventThrottle < MAX(0.017, now - _lastScrollDispatchTime))) { if (_DEPRECATED_sendUpdatedChildFrames) { // Calculate changed frames