Short description

After hitting Preview button in the Text mode, edit box scrolls back all the way to the top. If the user modified some place in the middle of the document he will have to scroll to that position himself. I noticed that at Wikipedia when you preview the page, edit box automatically moves to the last position in the edit box so there's no need for scrolling down to find where you left.

This could be solved if we save the position, for an example see http://aktuell.de.selfhtml.org/artikel/javascript/bbcode/

This feature would be useful for all users, especially those who type long texts in the edit box.

Discussion

I'm voting for this one. ESPECIALLY if it's a real simple fix (which I'm pretty sure it is). Note: this problem applies to the GUI editor as well as the markup editor. -- SteveDavison 2007-06-21 03:32:55

It seems that the fix is not simple, but possible. A rough sketch of what would be needed is:

  1. Have an onclick callback on the preview button, that would add two hidden form fields just before submitting, one with the scroll position and one with the cursor position. They can be obtained from textarea's scrollTop property, and from zero-selection, respectively.
  2. Have the editor code read those fields and put the values back when rendering the page with preview -- for example, it could put them directly into javascript, or into the aforementioned hidden fields.
  3. Have a short javascript that restores the saved cursor and scrolling position.

The first and third points are easy to do with just javascript. The second point is difficult, because MoinMoin's editor is not easily modified with plugins. The values could be maybe stored in the URL or cookie instead -- then a javascript-only solution is possible.


An alternative patch is proposed in FeatureRequests/AutoScrollingTheEditorTextArea. When you are previewing a page, it is possible to scroll the text editor window to the previous position (or the next bit of text that needs correcting) by double-clicking in the draft preview area.


CategoryFeatureRequest

MoinMoin: FeatureRequests/BackToSamePlaceInEditboxAfterPreview (last edited 2009-10-08 14:45:09 by RogerHaase)