Skip to content

Commit

Permalink
Fix breaks if layout provider and data providers are changed in the s…
Browse files Browse the repository at this point in the history
…ame pass (#401)
  • Loading branch information
naqvitalha authored and muskeinsingh committed Aug 21, 2019
1 parent 2b02129 commit 4387b3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/VirtualRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ export default class VirtualRenderer {

public refreshWithAnchor(): void {
if (this._viewabilityTracker) {
const firstVisibleIndex = this._viewabilityTracker.findFirstLogicallyVisibleIndex();
let firstVisibleIndex = this._viewabilityTracker.findFirstLogicallyVisibleIndex();
this._prepareViewabilityTracker();
let offset = 0;
if (this._layoutManager && this._params) {
firstVisibleIndex = Math.min(this._params.itemCount - 1, firstVisibleIndex);
const point = this._layoutManager.getOffsetForIndex(firstVisibleIndex);
this._scrollOnNextUpdate(point);
offset = this._params.isHorizontal ? point.x : point.y;
Expand Down

0 comments on commit 4387b3e

Please sign in to comment.