Does the selection produced by TextSelection.between(0, doc.firstChild.nodeSize) do what you are looking for? It’ll create a valid text selection from the first inline position in the doc to the last one in the body, which should still allow you to delete or overwrite the body’s content.
Can you share your editor content? I’m guessing you must have something like <blockquote><p></p></blockquote> in which case 0 would be the document, 1 would be in the blockquote but before the text content of the paragraph, and 2 would be the first text position. Normally 1 would be the first text position if the editor contained <p></p>
Oops, my mistake, I was using `TextSelection.create`.
With `TextSelection.between`, it reports error:
index.js:295 Uncaught TypeError: Cannot read properties of undefined (reading 'inlineContent')
at _TextSelection.between (index.js:295:27)
I am also wondering if say a codeblock is at the begining of body, the codeblock would remain there (although the content is cleared) after hitting delete with TextSelection.between, right?