Skip to content

Commit e0bbc28

Browse files
committed
fix(grid): Add RightClick/context menu check
fix(grid): Do not end editing on RMB click #8187 test(grid): Add Test - RMBClick/context menu #8187 on edited cell.
1 parent 77a8ecf commit e0bbc28

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,10 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
743743
this.selectionService.addKeyboardRange();
744744
this.selectionService.initKeyboardState();
745745
this.selectionService.primaryButton = false;
746-
this.gridAPI.submit_value();
746+
// Ensure RMB Click on edited cell does not end cell editing
747+
if (!this.selected) {
748+
this.gridAPI.submit_value();
749+
}
747750
return;
748751
}
749752
this.selectionService.pointerDown(this.selectionNode, event.shiftKey, event.ctrlKey);

projects/igniteui-angular/src/lib/grids/grid/grid-cell-selection.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,6 +2584,12 @@ describe('IgxGrid - Cell selection #grid', () => {
25842584
cell.editValue = 'No name';
25852585
fix.detectChanges();
25862586

2587+
UIInteractions.simulateNonPrimaryClick(cell);
2588+
fix.detectChanges();
2589+
expect(cell.editMode).toEqual(true);
2590+
expect(cell.editValue).toEqual('No name');
2591+
expect(cell.value).not.toEqual('No name');
2592+
25872593
const target = grid.getCellByColumn(0, 'Age');
25882594
UIInteractions.simulateNonPrimaryClick(target);
25892595
fix.detectChanges();

0 commit comments

Comments
 (0)