I have CodeMirror installed on a 1.27.1 version of MediaWiki. It works well enough that I would like to keep it. However, there is one quality of life issue that constantly annoys me. As the site administrator, I'm often working on complex templates or making large changes. I hit the Show Preview button almost reflexively after every change and I'm used to being scrolled directly to the preview. I have my preview set to display BELOW the editor. This is for a few reasons but the option exists in MediaWiki preferences so it should be supported.
When I press Show Preview with CodeMirror enabled I'm scrolled immediately to the top of the page. Since my preview location is below the editor, this means that I'm scrolled to the editor, basically where I was already, and not to the preview.
The Expected Behavior
When the Show Preview button is pressed the window should scroll to the top of the preview wherever it is located. This is the normal behavior in MediaWiki.
Steps to reproduce the issue:
- Set the preview to display below the editor (Preferences > Editing > Preview > Uncheck "Show preview before edit box")
- Edit a page (article, category, any page)
- Enable CodeMirror if it is not enabled by default
- Press Show Preview (shortcut: alt + shift + p)
This should cause the page to scroll to the top instead of to the page preview.