Last modified: 2014-04-18 19:21:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 41911 - WikiEditor scrolls textbox to the first line and removes focus
WikiEditor scrolls textbox to the first line and removes focus
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: javascript
: 31506 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2012-11-09 08:51 UTC by Michael M.
Modified: 2014-04-18 19:21 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Michael M. 2012-11-09 08:51:03 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.
Comment 1 Andre Klapper 2012-11-12 11:18:46 UTC
This is always reproducible, I assume?
Comment 2 Gerrit Notification Bot 2014-04-08 09:59:26 UTC
Change 124567 had a related patch set uploaded by TheDJ:
Preserve textarea state when building WikiEditor UI
Comment 3 Derk-Jan Hartman 2014-04-08 15:42:46 UTC
*** Bug 31506 has been marked as a duplicate of this bug. ***
Comment 4 Gerrit Notification Bot 2014-04-16 19:35:08 UTC
Change 124567 merged by jenkins-bot:
Preserve textarea state when building WikiEditor UI

Note You need to log in before you can comment on or make changes to this bug.