From e682dc98a7c57f553752df3f4449a1c2f4c81c66 Mon Sep 17 00:00:00 2001 From: VDyulgerov Date: Tue, 8 Mar 2022 14:40:11 +0200 Subject: [PATCH 1/3] fix(grid): add addtional check for cellID --- projects/igniteui-angular/src/lib/grids/cell.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/igniteui-angular/src/lib/grids/cell.component.ts b/projects/igniteui-angular/src/lib/grids/cell.component.ts index 950bcd0b8d4..2a2cb3a5f2b 100644 --- a/projects/igniteui-angular/src/lib/grids/cell.component.ts +++ b/projects/igniteui-angular/src/lib/grids/cell.component.ts @@ -947,7 +947,11 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellT if (this.editable && editMode && !this.intRow.deleted) { if (editableCell) { - editableArgs = this.grid.crudService.updateCell(false, event); + if (this.grid.rowEditable && editableCell?.id !== this.cellID && this.row) { + this.grid.crudService.endEdit(true, event); + } else { + editableArgs = this.grid.crudService.updateCell(false, event); + } /* This check is related with the following issue #6517: * when edit cell that belongs to a column which is sorted and press tab, From f7a8cf8933114dc6dfc81d9cbb7848277e8724a9 Mon Sep 17 00:00:00 2001 From: VDyulgerov Date: Mon, 14 Mar 2022 14:10:34 +0200 Subject: [PATCH 2/3] fix(grid): prevent cell edit exit double emit --- .../igniteui-angular/src/lib/grids/common/crud.service.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/projects/igniteui-angular/src/lib/grids/common/crud.service.ts b/projects/igniteui-angular/src/lib/grids/common/crud.service.ts index 3b7664dbc8d..884a8e81ac3 100644 --- a/projects/igniteui-angular/src/lib/grids/common/crud.service.ts +++ b/projects/igniteui-angular/src/lib/grids/common/crud.service.ts @@ -525,21 +525,18 @@ export class IgxGridCRUDService extends IgxRowAddCrudState { this.grid.tbody.nativeElement.focus(); } } else { - - this.createCell(cell); if (this.rowEditing) { // TODO rowData - if (this.row && !this.sameRow(this.cell?.id?.rowID)) { + if (this.row && !this.sameRow(cell?.cellID?.rowID)) { this.rowEditingBlocked = this.endEdit(true, event); if (this.rowEditingBlocked) { return true; } - // If enters here, @endEdit clears the new reference of the cell edit. - this.createCell(cell); this.rowEditingBlocked = false; this.endRowEdit(); } + this.createCell(cell); const canceled = this.beginRowEdit(event); if (!canceled) { @@ -547,6 +544,7 @@ export class IgxGridCRUDService extends IgxRowAddCrudState { } } else { + this.createCell(cell); this.beginCellEdit(event); } } From 3fb0fe0b914b695cc706eb26ade3c75e7d2312b0 Mon Sep 17 00:00:00 2001 From: VDyulgerov Date: Mon, 14 Mar 2022 14:38:36 +0200 Subject: [PATCH 3/3] fix(grid): remove not working code --- projects/igniteui-angular/src/lib/grids/cell.component.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/projects/igniteui-angular/src/lib/grids/cell.component.ts b/projects/igniteui-angular/src/lib/grids/cell.component.ts index 2a2cb3a5f2b..950bcd0b8d4 100644 --- a/projects/igniteui-angular/src/lib/grids/cell.component.ts +++ b/projects/igniteui-angular/src/lib/grids/cell.component.ts @@ -947,11 +947,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellT if (this.editable && editMode && !this.intRow.deleted) { if (editableCell) { - if (this.grid.rowEditable && editableCell?.id !== this.cellID && this.row) { - this.grid.crudService.endEdit(true, event); - } else { - editableArgs = this.grid.crudService.updateCell(false, event); - } + editableArgs = this.grid.crudService.updateCell(false, event); /* This check is related with the following issue #6517: * when edit cell that belongs to a column which is sorted and press tab,