When you have a selection of text, then click away blurring the component, then click back focusing the component again, the same selection remains. A second click must then be performed to clear the selection and place the cursor under the mouse.
This is bazaar and not the way textareas normally behave.
Normally when you blur a textarea, the selection is lost, and when you focus a textarea, the cursor is placed at the point in which you clicked.
I am trying recreate the normal textarea behavior and nothing I try seems to do the trick.
Since this only happens if there is a current selection. And it behaves correctly if there is no selection. My thought is to clear the selection on blur.
I have tried various combinations of using moveSelectionToEnd, and forceSelection and acceptSelection with SelectionState.createEmpty but nothing I try actually clears the selection. The previous selection is always there when I focus the component.
What is the appropriate way to clear the selection on blur and place the cursor at the correct spot on focus, the way a generic textarea behaves?