mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 09:59:48 +02:00
Fix addMark/removeMark caused unexpected onChange. (#4227)
* Fix addMark/removeMark caused unexpected onChange. * Create three-parrots-remember.md Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
This commit is contained in:
5
.changeset/three-parrots-remember.md
Normal file
5
.changeset/three-parrots-remember.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixed a bug that would allow multiple changes to be scheduled at the same time.
|
@@ -106,7 +106,9 @@ export const createEditor = (): Editor => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editor.marks = marks
|
editor.marks = marks
|
||||||
editor.onChange()
|
if (!FLUSHING.get(editor)) {
|
||||||
|
editor.onChange()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -296,7 +298,9 @@ export const createEditor = (): Editor => {
|
|||||||
const marks = { ...(Editor.marks(editor) || {}) }
|
const marks = { ...(Editor.marks(editor) || {}) }
|
||||||
delete marks[key]
|
delete marks[key]
|
||||||
editor.marks = marks
|
editor.marks = marks
|
||||||
editor.onChange()
|
if (!FLUSHING.get(editor)) {
|
||||||
|
editor.onChange()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user