Skip to content

Commit

Permalink
fix(search): observe highlight when changing inEditMode #3637
Browse files Browse the repository at this point in the history
  • Loading branch information
DiyanDimitrov committed Jan 17, 2019
1 parent c6e333b commit 1a873a0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions projects/igniteui-angular/src/lib/grids/cell.component.ts
Expand Up @@ -267,12 +267,15 @@ export class IgxGridCellComponent implements OnInit, AfterViewInit {
*/
get inEditMode(): boolean {
const editableCell = this.gridAPI.get_cell_inEditMode(this.gridID);
if (editableCell) {
return this.cellID.rowID === editableCell.cellID.rowID &&
this.cellID.columnID === editableCell.cellID.columnID;
} else {
return false;
const result = editableCell ? this.cellID.rowID === editableCell.cellID.rowID &&
this.cellID.columnID === editableCell.cellID.columnID : false;

if (result && !this._cellEditMode && this.highlight && this.grid.lastSearchInfo.searchText) {
this.highlight.observe();
}
this._cellEditMode = result;

return result;
}

/**
Expand All @@ -289,9 +292,6 @@ export class IgxGridCellComponent implements OnInit, AfterViewInit {
if (this.column.editable && value) {
this.focused = true;
this.gridAPI.set_cell_inEditMode(this.gridID, this);
if (this.highlight && this.grid.lastSearchInfo.searchText) {
this.highlight.observe();
}
this.editValue = this.value;
} else {
this.gridAPI.escape_editMode(this.gridID, this.cellID);
Expand Down Expand Up @@ -498,6 +498,7 @@ export class IgxGridCellComponent implements OnInit, AfterViewInit {
private cellSelectionID: string;
private prevCellSelectionID: string;
private previousCellEditMode = false;
private _cellEditMode: boolean;

constructor(
public gridAPI: GridBaseAPIService<IgxGridBaseComponent>,
Expand Down

0 comments on commit 1a873a0

Please sign in to comment.