Use selectionStart and selectionEnd instead of the text itself