IgxGrid does not reflect a value selected on IgxSelect used as the editor template when overlay animation is disabled
Description
IgxGrid does not reflect a selected value from IgxSelect which is the editor template. This only happens when the open and close animation of IgxSelect are disabled. A similar issue was reported and it has already been fixed. https://github.com/IgniteUI/igniteui-angular/issues/9629
- igniteui-angular version: 11.1.15
- browser: n/a
Steps to reproduce
- Run the attached sample
- Start editing on column1 (=> It leads to open IgxSelect)
- Select an item from IgxSelect
Result
The selected item on step 3 is not reflected on IgxGrid cell.
Expected result
The selected item on step 3 is reflected on IgxGrid cell.
Attachments
In handleClosed you are calling this.grid1.endEdit(true). However at this point ngModel did not succeed to update the cell edit value. This is why you are actually updating the cell with its old value. One way to solve this is to call endEdit in setTimeout. This will allow ngModel to update the value and endEdit will use updated value. Note you should also call detectChanges as endEdit will not do this. Here is how event may look like:
handleClosed(cell: IgxGridCellComponent) {
setTimeout(() => {
console.log('handleClosed');
// End edit mode of IgxGrid once IgxSelect closes.
this.grid1.endEdit(true);
this.grid1.cdr.detectChanges();
}, 0);
}
Hi @wnvko, Thank you for looking into this issue. I see your code works on my end as well.