I have a need to reset the copy, cut, and paste shortcuts, so the solution is that I use keymap to override the default shortcuts.
Then when I got the content selected by the user’s cursor, I found that when state.selection.ranges returns, from and to are always 0, which is inconsistent with the actual selection of the user. At the same time, I use changeByRange to manually set and then execute state.selection.ranges to return incorrectly.
This seems to be a bug
package:
“@codemirror/state”: “^6.2.1”,
“@codemirror/view”: “6.13.2”,