You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. :)
The text was updated successfully, but these errors were encountered:
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 anonUndo
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. :)
The text was updated successfully, but these errors were encountered: