Skip to content

Commit

Permalink
Fixes wrong time unit of scroll event throttle (#25098)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Jun 3, 2019
1 parent 9a053fc commit 1148c03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions React/Views/ScrollView/RCTScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1148c03

Please sign in to comment.