Skip to content

Commit 5dc5d45

Browse files
authored
Merge pull request #10186 from IgniteUI/sstoychev/bug-10117-master
fix(row-add): resolve targetting correct unpinned row #10117 - master
2 parents 0ebe2cd + f02e2cf commit 5dc5d45

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
@@ -586,7 +586,9 @@ export class IgxGridCRUDService extends IgxRowAddCrudState {
586586
this.grid.notifyChanges(true);
587587

588588
this.grid.navigateTo(this.row.index, -1);
589-
const dummyRow = this.grid.gridAPI.get_row_by_index(this.row.index);
589+
// when selecting the dummy row we need to adjust for top pinned rows
590+
const indexAdjust = this.grid.isRowPinningToTop && !this.addRowParent.isPinned ? this.grid.pinnedRows.length : 0;
591+
const dummyRow = this.grid.gridAPI.get_row_by_index(this.row.index + indexAdjust);
590592
dummyRow.triggerAddAnimation();
591593
dummyRow.cdr.detectChanges();
592594
dummyRow.addAnimationEnd.pipe(first()).subscribe(() => {

0 commit comments

Comments
 (0)