Skip to content

Mismatched transaction error #6097

Closed Answered by dan-cooke
dan-cooke asked this question in Questions & Help
Discussion options

You must be logged in to vote

Okay I have found the source of the issue..

You cannot use editor from the command

ie.

---   createRule:
---   (attrs: RuleAttrs) =>
---        ({ editor  }) => {
---     const { from, to } = editor.state.selection;


+++      createRule:
+++       (attrs: RuleAttrs) =>
+++        ({ chain, tr, state }) => {
+++          const { from, to } = tr.selection;

This is extremely annoying behaviour, and I have no clue why those two aren't equivalent, nor why this is not documented.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dan-cooke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant