Detect if transaction is an undo/redo event

Within an EditorState.transactionFilter I would like to know if a given transaction is an undo or redo event (i.e., it was emitted by the history Extension).

Is there a way to do this?

It looks like there’s an Annotation for the history, but I’m unsure how I can use that to detect if the transaction contains a change that’s emitted from history. :thinking:

Use transaction.isUserEvent("undo") || transaction.isUserEvent("redo")

1 Like