I am currently dealing with an issue in my application where I am using ui-grid along with cellNav and setting editOnFocus=true for certain columns. The problem arises when the END_CELL_EDIT and CANCEL_CELL_EDIT events in the edit feature always trigger gridCtrl.focus(). This causes a situation where if I have a focus on an editable cell and then click on an input field outside of the grid, the focus is immediately stolen back by the grid.
When I click on an input field outside of the grid, it correctly receives focus. However, simultaneously the END_CELL_EDIT event is fired, leading to gridCtrl.focus() being called and shifting the focus away from the external input field.
I am looking for a way to override this default behavior in ui-grid.edit. Why is this behavior considered standard? Is there a solution to prevent the grid from constantly stealing the focus back?
To demonstrate this issue, you can check out this plnkr example. If you click on the age column to enable editing mode and then click on the text area, you will notice that the focus shifts momentarily before returning to the grid, making further edits impossible.
http://plnkr.co/edit/Sg1dTcsMN0zNRDmauwoT
This behavior does not align with our requirements as we automatically set the focus on a specific cell (entering edit mode) whenever the row is selected or navigated to. As a result, any action that changes rows or moves the focus outside of the grid triggers the END_CELL_EDIT event and the unwelcome focus behavior described above.