Last modified: 2014-04-18 19:21:39 UTC
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: 1. Open a long article for editing, scroll down a bit. 2. Hit preview (make sure you don't use LivePreview). 3. When your computer is slow enough, focus the textarea before WikiEditor loads. 4. Wait for WikiEditor to initialize. Expected result: 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). Actual result: 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.
This is always reproducible, I assume?
Change 124567 had a related patch set uploaded by TheDJ: Preserve textarea state when building WikiEditor UI https://gerrit.wikimedia.org/r/124567
*** Bug 31506 has been marked as a duplicate of this bug. ***
Change 124567 merged by jenkins-bot: Preserve textarea state when building WikiEditor UI https://gerrit.wikimedia.org/r/124567