Skip to content

Commit a744ea0

Browse files
authored
Merge pull request #6534 from IgniteUI/ddincheva/cellEditingFocus
Fix: edit value is not correct when there is sorted column
2 parents d7d0d5f + 02de3b5 commit a744ea0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,16 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
620620
if (this.editable && editMode && !this.row.deleted) {
621621
if (editableCell) {
622622
this.gridAPI.update_cell(editableCell, editableCell.editValue);
623+
/* This check is related with the following issue #6517:
624+
* when edit cell that belongs to a column which is sorted and press tab,
625+
* the next cell in edit mode is with wrong value /its context is not updated/;
626+
* So we reapply sorting before the next cell enters edit mode.
627+
* Also we need to keep the notifyChanges below, because of the current
628+
* change detection cycle when we have editing with enabled transactions
629+
*/
630+
if (this.grid.sortingExpressions.length && this.grid.sortingExpressions.indexOf(editableCell.column.field)) {
631+
this.grid.cdr.detectChanges();
632+
}
623633
}
624634
crud.end();
625635
this.grid.notifyChanges();

0 commit comments

Comments
 (0)