Last modified: 2014-01-30 18:24:41 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 31780 - WikiEditor dialogs kill the undo buffer in IE and Chrome
WikiEditor dialogs kill the undo buffer in IE and Chrome
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikiEditor (Other open bugs)
All All
: Normal major with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: upstream
: 23509 36544 (view as bug list)
Depends on:
Blocks: edit-toolbar
  Show dependency treegraph
Reported: 2011-10-17 16:10 UTC by Dan Barrett
Modified: 2014-01-30 18:24 UTC (History)
5 users (show)

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


Description Dan Barrett 2011-10-17 16:10:44 UTC
In WikiEditor, if you use the Link dialog (or any other 'dialog') to insert text into the edit box, then press control-Z, the edit does not get undone. This is true of all the supplied dialogs, including one I custom-developed.

Confirmed in IE 8.0.7600.16385 and Chrome 14.0.835.202m, on English Wikipedia today.

Works correctly in Firefox 7.0.1.

Other buttons and dropdowns work fine, allowing undo with ctrl-Z.
Comment 1 Dan Barrett 2011-10-21 18:03:39 UTC
Raising the priority and changing the title -- this problem actually kills the entire "undo" buffer for the textarea in IE and Chrome.
Comment 2 Dan Barrett 2011-10-21 18:05:19 UTC
By "kills the undo buffer," I mean that once you insert text via a dialog, the textarea's current undo buffer gets cleared. So any previous typing you've done can no longer be undone via ctrl-Z.
Comment 3 Dan Barrett 2011-10-21 19:38:10 UTC
Actually, if you merely *display* a WikiEditor dialog, it clears the undo buffer. You don't even have to use the dialog. Just displaying it is enough to trigger the problem.

Simple test:

1. Edit an article in IE8 or Chrome.
2. Type "abc"
3. Click the Link button to display the Link dialog
4. Hit ESC to close the dialog (don't use it in any other way)
5. Type ctrl-Z.  The "abc" cannot be undone.
Comment 4 Dan Barrett 2011-10-21 20:30:02 UTC
Clarification to the preceding comment:

- In IE, merely displaying and closing the dialog kills the undo buffer.

- In Chrome, inserting text via a dialog kills the undo buffer. Merely displaying the dialog does not.
Comment 5 Brion Vibber 2011-10-21 22:58:01 UTC
Looks like IE resets the undo buffers when elements get added to the DOM -- shows an example page.

Not sure there's much we can do about that; seems to happen through IE 9. :P The dialog setup would be clearing the buffer, I guess.

On Chrome I can confirm that it seems to reset the undo buffer when we do an insert even through for instance the bold button, which has no dialog. Looks like changing the textarea contents itself resets the undo buffer... which seems to defeat the purpose. ;)

On IE 8, the bold button seems to integrate properly into the undo/redo buffers. Type "xxx", then double-click a word and boldify it. First undo undoes the bold, second undoes the "xxx".

On IE 9, the bold button *almost* seems to be ok, but is actually messed up. First undo instead of removing the bold removes a few characters at what was originally the offset of the "xxx", but isn't anymore because we've added characters for the bold. Eeek!

[Note that on IE we do encapsulateText insertions through selection manipulation, while on other browsers we have no such API and perform them by splicing some strings and replacing the text contents of the entire textarea.]
Comment 6 Mark A. Hershberger 2011-11-14 21:02:30 UTC
This is totally an upstream problem, then, right?
Comment 7 Helder 2012-05-05 18:22:28 UTC
*** Bug 23509 has been marked as a duplicate of this bug. ***
Comment 8 Beau 2012-05-05 18:23:24 UTC
*** Bug 36544 has been marked as a duplicate of this bug. ***
Comment 9 Helder 2012-05-05 18:28:33 UTC
I just noticed that the problem also happens with the old toolbar on this page:
(from bug 36544).

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