Skip to content

Commit 7bd92df

Browse files
MKirovaMKirova
authored andcommitted
fix(igxGrid): Fix offset when using virtual scrollbar with ratio.
1 parent 1c1dc75 commit 7bd92df

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,11 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
271271
protected _differ: IterableDiffer<T> | null = null;
272272
protected _trackByFn: TrackByFunction<T>;
273273
protected individualSizeCache: number[] = [];
274+
/**
275+
* @hidden
276+
*/
274277
/** Internal track for scroll top that is being virtualized */
275-
protected _virtScrollPosition = 0;
278+
public _virtScrollPosition = 0;
276279
/** If the next onScroll event is triggered due to internal setting of scrollTop */
277280
protected _bScrollInternal = false;
278281
// End properties related to virtual height handling

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3718,7 +3718,7 @@ export abstract class IgxGridBaseDirective implements GridType,
37183718

37193719
protected getMergeCellOffset(rowData) {
37203720
const index = rowData.dataIndex;
3721-
let offset = this.verticalScrollContainer.scrollPosition - this.verticalScrollContainer.getScrollForIndex(index);
3721+
let offset = this.verticalScrollContainer._virtScrollPosition - this.verticalScrollContainer.getScrollForIndex(index);
37223722
if (this.hasPinnedRecords && this.isRowPinningToTop) {
37233723
offset -= this.pinnedRowHeight;
37243724
}

0 commit comments

Comments
 (0)