Skip to content

Commit e491681

Browse files
MKirovaMKirova
authored andcommitted
chore(*): Update size if repaint was requested. Optimize a bit index calc.
1 parent cbf4a1c commit e491681

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

projects/igniteui-angular/src/lib/grids/row.directive.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ export class IgxRowDirective implements DoCheck, AfterViewInit, OnDestroy {
613613
protected getMergeCellSpan(col: ColumnType) {
614614
const rowCount = this.metaData.cellMergeMeta.get(col.field).rowSpan;
615615
let sizeSpans = "";
616-
const indexInData = this.pinned ? this.grid.getInitialPinnedIndex(this.data):
617-
this.grid.verticalScrollContainer.igxForOf.indexOf(this.metaData);
616+
const isPinned = this.pinned && !this.disabled;
617+
const indexInData = this.grid.isRowPinningToTop && !isPinned ? this.index - this.grid.pinnedRecordsCount : this.index;
618618
for (let index = indexInData; index < indexInData + rowCount; index++) {
619619
const size = this.grid.verticalScrollContainer.getSizeAt(index);
620620
sizeSpans += size + 'px ';
@@ -659,7 +659,12 @@ export class IgxRowDirective implements DoCheck, AfterViewInit, OnDestroy {
659659
}
660660

661661
protected getRowHeight() {
662-
const indexInData = this.grid.verticalScrollContainer.igxForOf.indexOf(this.metaData);
662+
const isPinned = this.pinned && !this.disabled;
663+
const indexInData = this.grid.isRowPinningToTop && !isPinned ? this.index - this.grid.pinnedRecordsCount : this.index;
664+
if ((this.grid as any)._cdrRequests) {
665+
// recalc size if repaint is requested.
666+
this.grid.verticalScrollContainer.recalcUpdateSizes();
667+
}
663668
const size = this.grid.verticalScrollContainer.getSizeAt(indexInData) - 1;
664669
return size || this.grid.rowHeight;
665670
}

0 commit comments

Comments
 (0)