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
{{ message }}
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
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. :)
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
onRemoveoption to mapped decorations, you can add anonUndooption 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. :)