Auto-end cell editing to prevent nullptr exception on submission