Skip to content

Commit ebe2827

Browse files
zhongwuzwkelset
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 dbf27f5 commit ebe2827

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

React/Views/ScrollView/RCTScrollView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,10 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView
685685
* warnings, and behave strangely (ListView works fine however), so don't fix it unless you fix that too!
686686
*
687687
* We limit the delta to 17ms so that small throttles intended to enable 60fps updates will not
688-
* inadvertantly filter out any scroll events.
688+
* inadvertently filter out any scroll events.
689689
*/
690690
if (_allowNextScrollNoMatterWhat ||
691-
(_scrollEventThrottle > 0 && _scrollEventThrottle < MAX(17, now - _lastScrollDispatchTime))) {
691+
(_scrollEventThrottle > 0 && _scrollEventThrottle < MAX(0.017, now - _lastScrollDispatchTime))) {
692692

693693
if (_DEPRECATED_sendUpdatedChildFrames) {
694694
// Calculate changed frames

0 commit comments

Comments
 (0)