Closed domakas closed 1 year ago
The editor ignores selections that aren't inside of its editable element. By selecting the editor element, you're creating a range that starts before and ends after the editor, which is thus ignored. This is intentional behavior.
When trying to create new range selection programmatically, this selection is not updated in prosemirror editor.
Eg.: when calling
content inside editor is selected, however new transaction is not triggered and selection is not updated inside prosemirror state.
Demo for reproduction: https://codesandbox.io/s/green-bird-qr5s5b?file=/src/index.js In this example you can see that when clicking "Select All" button, new transaction is not triggered, however when, for example you click
Cmd+A
selection is changed and transaction is created.Potential use cases, which are blocked by this issue: selecting content with puppeteer when running automated tests.