positioning caret at end of the text