-
-
Notifications
You must be signed in to change notification settings - Fork 370
Open
Description
Following discussion in forum about being able to undo decoration deletions: https://discuss.prosemirror.net/t/add-inverse-of-decoration-step-to-history/1342/3
One idea for the API, is that, similar to how you can add an onRemove option to mapped decorations, you can add an onUndo option to the meta transaction. E.g. tr.setMeta(key, value, { onUndo: Function(tr) }) and let the user handle the logic for restoring a specific decoration based on the previous transaction.
I feel like that's a pretty simple way of handling this. But I'm not sure if there's any nuances I'm not taking into account, so opening this issue to start a discussion and see if we can land this feature. :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels