Remember cursor position on cell type change

closes #5688