Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions projects/igniteui-angular/src/lib/grids/cell.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,10 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellT
this.highlight.lastSearchInfo.caseSensitive = this.grid.lastSearchInfo.caseSensitive;
this.highlight.lastSearchInfo.exactMatch = this.grid.lastSearchInfo.exactMatch;
}
const isInEdit = this.grid.rowEditable ? this.row.inEditMode : this.editMode;
if (this.formControl && this.formControl.value !== changes.value.currentValue && !isInEdit) {
this.formControl.setValue(changes.value.currentValue);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,27 @@ describe('IgxGrid - Cell Editing #grid', () => {
expect(cell.value).not.toEqual(cellValue);
expect(cell.value).toEqual(newValue);
});

it('should update editValue when externally changing grid data.', () => {
const cell = grid.getCellByColumn(0, 'fullName');
cell.editMode = true;
fixture.detectChanges();

expect(cell.editMode).toBeTruthy();
expect(cell.editValue).toBe('John Brown');

fixture.detectChanges();
cell.editMode = false;
fixture.detectChanges();

grid.data[0].fullName = "Test";
grid.cdr.detectChanges();

cell.editMode = true;
fixture.detectChanges();
expect(cell.editMode).toBeTruthy();
expect(cell.editValue).toBe('Test');
});
});

describe('Integration tests', () => {
Expand Down
Loading