forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'perunt/onStartReached-fix' of https://github.com/margel…
…o/expensify-app-fork into feat/#Expensify#23229-linking
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
patches/@react-native+virtualized-lists+0.73.4+001+onStartReched.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js b/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js | ||
index 0516679..e338d90 100644 | ||
--- a/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js | ||
+++ b/node_modules/@react-native/virtualized-lists/Lists/VirtualizedList.js | ||
@@ -1546,7 +1546,7 @@ class VirtualizedList extends StateSafePureComponent<Props, State> { | ||
// Next check if the user just scrolled within the start threshold | ||
// and call onStartReached only once for a given content length, | ||
// and only if onEndReached is not being executed | ||
- else if ( | ||
+ if ( | ||
onStartReached != null && | ||
this.state.cellsAroundViewport.first === 0 && | ||
isWithinStartThreshold && | ||
@@ -1558,13 +1558,11 @@ class VirtualizedList extends StateSafePureComponent<Props, State> { | ||
|
||
// If the user scrolls away from the start or end and back again, | ||
// cause onStartReached or onEndReached to be triggered again | ||
- else { | ||
- this._sentStartForContentLength = isWithinStartThreshold | ||
- ? this._sentStartForContentLength | ||
- : 0; | ||
- this._sentEndForContentLength = isWithinEndThreshold | ||
- ? this._sentEndForContentLength | ||
- : 0; | ||
+ if (!isWithinStartThreshold) { | ||
+ this._sentStartForContentLength = 0; | ||
+ } | ||
+ if (!isWithinEndThreshold) { | ||
+ this._sentEndForContentLength = 0; | ||
} | ||
} | ||
|