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
Describe the bug
Redo no longer works in 1.1.0. UndoManager.afterTransactionHandler does not run when performing the undo because captureTransaction returns false. Since afterTransactionHandler does not run, the redoStack never gets filled with the undo operation.
To Reproduce
Steps to reproduce the behavior:
Modify testAddToHistory to also test redo:
exportconsttestAddToHistory=tc=>{constydoc=newY.Doc()constview=createNewProsemirrorViewWithUndoManager(ydoc)view.dispatch(view.state.tr.insert(0,/** @type {any} */(schema.node('paragraph',undefined,schema.text('123')))))constyxml=ydoc.get('prosemirror')t.assert(yxml.length===2&&yxml.get(0).length===1,'contains inserted content')undo(view.state)t.assert(yxml.length===0,'insertion was undone')redo(view.state)t.assert(yxml.length===2&&yxml.get(0).length===1,'contains inserted content')undo(view.state)t.assert(yxml.length===0,'insertion was undone')// now insert content again, but with `'addToHistory': false`view.dispatch(view.state.tr.insert(0,/** @type {any} */(schema.node('paragraph',undefined,schema.text('123')))).setMeta('addToHistory',false))t.assert(yxml.length===2&&yxml.get(0).length===1,'contains inserted content')undo(view.state)t.assert(yxml.length===2&&yxml.get(0).length===1,'insertion was *not* undone')}
Checklist
Describe the bug
Redo no longer works in 1.1.0.
UndoManager.afterTransactionHandler
does not run when performing the undo becausecaptureTransaction
returns false. SinceafterTransactionHandler
does not run, theredoStack
never gets filled with the undo operation.To Reproduce
Steps to reproduce the behavior:
testAddToHistory
to also testredo
:Expected behavior
Test Passes
Environment Information
The text was updated successfully, but these errors were encountered: