diff --git a/.changeset/friendly-socks-divide.md b/.changeset/friendly-socks-divide.md new file mode 100644 index 000000000..04d6a5e71 --- /dev/null +++ b/.changeset/friendly-socks-divide.md @@ -0,0 +1,5 @@ +--- +'slate-history': patch +--- + +Fix certain undos undoing more than they should diff --git a/packages/slate-history/src/with-history.ts b/packages/slate-history/src/with-history.ts index 8b1fa083e..444121810 100644 --- a/packages/slate-history/src/with-history.ts +++ b/packages/slate-history/src/with-history.ts @@ -83,7 +83,7 @@ export const withHistory = (editor: T) => { if (merge == null) { if (lastBatch == null) { merge = false - } else if (operations.length !== 0) { + } else if (operations.includes(lastOp)) { merge = true } else { merge = shouldMerge(op, lastOp)