IgxGrid - Cell selection does not update visually if you click on the text part of a grid cell.
Description
Cell selection does not update visually if you click on the text part of a grid cell. In IE 11 only.
- igniteui-angular version: igniteui-angular version: 6.2.x
- browser: browser: IE11
Steps to reproduce
- Load dev demos and open the first grid sample (named "Grid")
- Click on a cell (for example "Chai") but click on the white area of the cell
- Now click on another cell (for example "Aniseed Syrup") but this time click on the text itself.
Result
The selection highlight is not updated and the first cell still looks selected. However if you try to navigate with the keyboard the correct cell is highlighted.
Expected result
The cell selection highlight should work correctly no matter if you are clicking on the cell's text or the cell's white space.
The behavior is caused by an issue in Internet Explorer 11. The browser prevents the div's parent container to get focus. The fix for IE should be enabled by adding a registry key in the Registry Editor - Fix for Internet Explorer
As a workaround, when the div element receives focus it could be moved to the IgxGridCellComponent.
cell.component.html:
<ng-container ... >
<div class="igx-grid__td-text" (focus)="changeFocus()">...</div>
</ng-container>
<ng-template ...>
<div class="igx-grid__td-text" (focus)="changeFocus()">...</div>
</ng-template>
cell.component.ts:
public changeFocus() {
this.nativeElement.focus();
}