Skip to content

Commit 0e8e0ed

Browse files
committed
fix(row-add): resolve targetting correct unpinned row #10117
1 parent a0e631e commit 0e8e0ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

projects/igniteui-angular/src/lib/grids/common/crud.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,9 @@ export class IgxGridCRUDService extends IgxRowAddCrudState {
577577
this.grid.notifyChanges(true);
578578

579579
this.grid.navigateTo(this.row.index, -1);
580-
const dummyRow = this.grid.gridAPI.get_row_by_index(this.row.index);
580+
// when selecting the dummy row we need to adjust for top pinned rows
581+
const indexAdjust = this.grid.isRowPinningToTop && !this.addRowParent.isPinned ? this.grid.pinnedRows.length : 0;
582+
const dummyRow = this.grid.gridAPI.get_row_by_index(this.row.index + indexAdjust);
581583
dummyRow.triggerAddAnimation();
582584
dummyRow.cdr.detectChanges();
583585
dummyRow.addAnimationEnd.pipe(first()).subscribe(() => {

0 commit comments

Comments
 (0)