Merge pull request #10501 from Snuffleupagus/getVisibleElements-avoid-unnecessary-backtrack
In `getVisibleElements`, check `firstVisibleElementInd` rather than `numViews` before backtracking (PR 10443 follow-up)
This commit is contained in:
commit
d03d990e2e
@ -446,7 +446,8 @@ function getVisibleElements(scrollEl, views, sortByVisibility = false,
|
||||
|
||||
// Please note the return value of the `binarySearchFirstItem` function when
|
||||
// no valid element is found (hence the `firstVisibleElementInd` check below).
|
||||
if (numViews > 0 && firstVisibleElementInd < numViews && !horizontal) {
|
||||
if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews &&
|
||||
!horizontal) {
|
||||
// In wrapped scrolling (or vertical scrolling with spreads), with some page
|
||||
// sizes, isElementBottomAfterViewTop doesn't satisfy the binary search
|
||||
// condition: there can be pages with bottoms above the view top between
|
||||
|
Loading…
Reference in New Issue
Block a user