Automattic / isolated-block-editor

Repackages Gutenberg's editor playground as a full-featured multi-instance editor that does not require WordPress.
343 stars 50 forks source link

setUndoManager prevents access to existing history #136

Open johngodley opened 2 years ago

johngodley commented 2 years ago

If you are editing some content and have built up an undo history, and then setUndoManager is called, it prevents access to the existing history.

This may occur, for example, on P2 where you can be creating a new post (collab is disabled) and a draft is saved. At this point, collab mode is enabled (the conditions for it are now true) and existing undo history is lost. Given the right set of circumstances this could result in data being lost.

johngodley commented 2 years ago

You can also get the same effect if you start typing in an editor before setUndoManager is called. In my testing there's sometimes a 10 second gap from when the editor is editable and the undo manager kicks in.