Steps to replicate the issue (include links if applicable):
- Edit any page with CodeMirror 6 enabled and Realtime Preview disabled.
- Put the cursor at anywhere except the very beginning.
- Open Realtime Preview.
- Put the cursor at anywhere except the very beginning.
- Close Realtime Preview.
What happens?:
The cursor moves to a different position (usually the very beginning) when opening/closing Realtime Preview.
What should have happened instead?:
The cursor position should be preserved.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):
Maybe related to T311684