alohaeditor/Aloha-Editor — Issue #326: Undo can replace an editables content with content from another editable
Author: albinohrn
Created: 2011-10-18 11:41:42+00:00
State: open

If you start typing away in an editable then click in another editable(before the smart-content-change timer has run out). Now you click undo(ctrl/cmd + z) a couple of times and the content of the editable you're now in will be replaced with content from the editable you started in. (I've reproduced it in the aloha example i the dev branch)

When the smart-content-change event is triggered the Aloha.activeEditable is passed along to the listeners. The undo-plugin saves a command with the changes and the editable. In the undo process it replaces the content of the stored editable with the stored snapshotContent. When I click in another editable before the timer has timed out, there's a missmatch between the stored editable and the stored snapshotContent. Since snapshotContent is retrieved with me.getSnapshotContent() and the editable is Aloha.activeEditable.

Is there a reason why the variable me isn't passed as editable instead of the Aloha.activeEditable?