Skip to content

Commit 7b2bfcf

Browse files
MKirovaMKirova
authored andcommitted
fix(forOf): Full recalculate scroll position after large data change.
1 parent 3b00f0c commit 7b2bfcf

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,15 +1469,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
14691469
}
14701470

14711471
protected _updateScrollOffset() {
1472-
let scrollOffset = 0;
1473-
let currentScroll = this.scrollPosition;
1474-
if (this._virtRatio !== 1) {
1475-
this._calcVirtualScrollPosition(this.scrollPosition);
1476-
currentScroll = this._virtScrollPosition;
1477-
}
1478-
const scroll = this.scrollComponent.nativeElement;
1479-
scrollOffset = scroll && this.scrollComponent.size ?
1480-
currentScroll - this.sizesCache[this.state.startIndex] : 0;
1472+
const scrollOffset = this.fixedUpdateAllElements(this._virtScrollPosition);
14811473
const dir = this.igxForScrollOrientation === 'horizontal' ? 'left' : 'top';
14821474
this.dc.instance._viewContainer.element.nativeElement.style[dir] = -(scrollOffset) + 'px';
14831475
}

0 commit comments

Comments
 (0)