mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 02:49:56 +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:
@@ -106,7 +106,9 @@ export const createEditor = (): Editor => {
|
||||
}
|
||||
|
||||
editor.marks = marks
|
||||
editor.onChange()
|
||||
if (!FLUSHING.get(editor)) {
|
||||
editor.onChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -296,7 +298,9 @@ export const createEditor = (): Editor => {
|
||||
const marks = { ...(Editor.marks(editor) || {}) }
|
||||
delete marks[key]
|
||||
editor.marks = marks
|
||||
editor.onChange()
|
||||
if (!FLUSHING.get(editor)) {
|
||||
editor.onChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user