title: Select specific text in the editorState
body: <p>I'm creating a rich text editor using <a href="https://draftjs.org/" rel="nofollow noreferrer">draftjs</a>. Here is the minimal <a href="https://codesandbox.io/s/blissful-darkness-wtvhl?file=/src/App.tsx" rel="nofollow noreferrer">codesandbox</a> so you have an idea of what the issue is.</p>
  <p>So I have an helper function <code>getCurrentTextSelection</code> that return me the text that I'm selecting:</p>
  <pre class="lang-js prettyprint-override"><code>const getCurrentTextSelection = (editorState: EditorState): string =&gt; {
    const selectionState = editorState.getSelection();
    const anchorKey = selectionState.getAnchorKey();
    const currentContent = editorState.getCurrentContent();
    const currentContentBlock = currentContent.getBlockForKey(anchorKey);
    const start = selectionState.getStartOffset();
    const end = selectionState.getEndOffset();
    const selectedText = currentContentBlock.getText().slice(start, end);
  
    return selectedText;
  };
  </code></pre>
  <p>When I click outside the TextEditor, the focus is lost so the text isn't selected (but stay the selected one for the <code>editorState</code>).</p>
  <p>Is there a programmatic way to reselect this text using the <code>editorState</code>? So that when you click the <code>Select text again</code> button, the text in the TextEditor is selected.</p>