mediawiki.action.edit tries hard to preserve the scrollTop property of the textbox after submitting the form for preview, but WikiEditor seems to try to prevent that.
Steps to reproduce:
- Open a long article for editing, scroll down a bit.
- Hit preview (make sure you don't use LivePreview).
- When your computer is slow enough, focus the textarea before WikiEditor loads.
- Wait for WikiEditor to initialize.
The text is scrolled down a bit (as you left it before the preview), the focus is still in the textarea (if you focused it in step 3).
The text starts at the beginning, the focus is lost.
This happens in jquery.wikiEditor.js in line 502: $textarea.wrapAll() seems to reset the scrollTop property of the textbox as well as it removes the focus, at least in Firefox and Internet Explorer.
The scrollTop property and the fact that the textarea is focused should be saved before the WikiEditor structure is built in the DOM and restored afterwards.