1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 09:29:49 +02:00

Fix certain undos undoing more than they should (#5866)

* prevent false positives for history batch merging

* add changeset
This commit is contained in:
nabbydude
2025-05-14 15:01:55 -04:00
committed by GitHub
parent 98b115b7e1
commit 7f5f9e1c62
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'slate-history': patch
---
Fix certain undos undoing more than they should

View File

@@ -83,7 +83,7 @@ export const withHistory = <T extends Editor>(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)