Fixed a bug where the caret were not placed at the end of the selection when the selection was left to right