prevent selected line from jumping when losing focus