position the caret in the new input

This will position the caret when clicked, or create a selection inside the input if words are selected.

The only caveat is that it relies on the window selection to be in tact which gets reset when placed inside jquery ui sortable.