Prevent reflow in _InputTextlikeDirective

Setting selection range might trigger a reflow. Also simplifies the range set into a single operation.