How to save and restore editor state in memory #5196
Unanswered
MartinJaskulla
asked this question in
Questions & Help
Replies: 1 comment
-
@MartinJaskulla I encountered the same problem. Did you manage to assign a saved state in any way? It is worth noting that on the vanilla prosemirror everything works properly and no errors occur |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to save the current state of the editor in memory, then mount a different editor and restore the state including working undo/redo functionality.
These threads make me believe this is possible, but I cannot make it work:
https://discuss.prosemirror.net/t/how-to-restore-history-data-when-using-single-instance-of-editorview/5819
https://discuss.prosemirror.net/t/possible-to-store-history/823
I created a minimal reproduction:
git clone https://github.com/MartinJaskulla/tiptap-restore-edit-history.git
npm start
After the restore the previous content is displayed, but undo/redo does not work and after typing a few characters I get an "Uncaught RangeError".
I am saving
editor?.state
and then trying to restore it viaeditor?.view.updateState()
.Beta Was this translation helpful? Give feedback.
All reactions