When adding or removing a row above a focused cell in ag-grid, the focus moves automatically to the cell that gets "in the place" of the previously focused cell.
So if a cell on row 4 is focused, and a new row is added at the top of the grid, the focus moves to the cell that was previously on row 3, and now it's on row 4 because of the new insertion.
While this might make sense in some scenarios, this affects cell editing in a very bad way, because it stops the editing of a cell when a new row is added above. This means that an incomplete value can be persisted, eg "12" because the user was trying to type "1234" but the row insertion happened in between.
The funny thing is that rows can be freely added/removed below the focused cell, and because the focused cell does not change its row index, it remains focused/in edit mode, so no problem in that scenario.
One other thing is that row selection is not affected, the selected row will remain the same based on its id and not its row index, when other rows are added/removed above it.
How can I convince ag-grid to keep the focus on a cell based on identity, not row index, when its row index changes? Thank you!