Suggested patch for fixing selecting text position and range of text

(introduced from the previous patch)
But, another bug got introduced from this.
When deleting using backspace or delete key, row does not get slides
accordingly in a scrolled row.