-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operation.toJSON does not save selection's value - Saving history #2672
Comments
@callingmybluff there's an option to |
Did you try the example? It does nothing, or I am using it wrong? According to the documentation, it reserves JSON for the data as a whole, not to |
Possible solution would probably be by adding (as in: https://jsfiddle.net/Ismaeel/xvgoqLn2/40/) :
I will create a pull request for it |
As of #3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I'm going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding. |
Do you want to request a feature or report a bug?
A bug
What's the current behavior?
https://jsfiddle.net/Ismaeel/xvgoqLn2/
Click To Do Nothing
(it will reset the history by using the history itself, but each operations is re sat to its value after to/from JSON:op = Operation.fromJSON(op.toJSON())
this.editor.undo
.Uncaught TypeError: Cannot read property 'merge' of undefined
Slate 0.44.12, Chrome latest (73.0.3683.86 64bit), and Windows7
What's the expected behavior?
I would like to save the history in a JSON and load from a JSON too (replay what the user did step per step). I can use something like
deep-diff
, but using them would be much faster (although maybe not memory-friendly).If you think this is a valid bug and you would accept a pull request for it, I will happily do that. Please let me know if you want me to create an example for it, too (or extend the versioning example as it only saves in memory for now).
The text was updated successfully, but these errors were encountered: