This repository was archived by the owner on Feb 2, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ @interface ASRangeControllerBeta ()
3737 BOOL _rangeIsValid;
3838 BOOL _queuedRangeUpdate;
3939 ASScrollDirection _scrollDirection;
40+ NSMutableSet *_allPreviousIndexPaths;
4041}
4142
4243@end
@@ -112,6 +113,12 @@ - (void)_updateVisibleNodeIndexPaths
112113 [allIndexPaths unionSet: displayIndexPaths];
113114 [allIndexPaths unionSet: visibleIndexPaths];
114115
116+ // Sets are magical. Add anything we had applied interfaceState to in the last update, so we can clear any
117+ // range flags it still has enabled. Most of the time, all but a few elements are equal; a large programmatic
118+ // scroll or major main thread stall could cause entirely disjoint sets, but we must visit all.
119+ [allIndexPaths unionSet: _allPreviousIndexPaths];
120+ _allPreviousIndexPaths = allIndexPaths;
121+
115122 for (NSIndexPath *indexPath in allIndexPaths) {
116123 // Before a node / indexPath is exposed to ASRangeController, ASDataController should have already measured it.
117124 // For consistency, make sure each node knows that it should measure itself if something changes.
You can’t perform that action at this time.
0 commit comments