mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-16 12:14:14 +02:00
Prevent history mutation during initialization (#1329)
* fix history on init * fix setValue save logic * update comment
This commit is contained in:
committed by
Ian Storm Taylor
parent
d0172eac17
commit
e29caf46ec
@@ -109,9 +109,10 @@ function BeforePlugin() {
|
||||
|
||||
// If the value's schema isn't the editor's schema, update it. This can
|
||||
// happen on the initialization of the editor, or if the schema changes.
|
||||
// This change isn't save into history since only schema is updated.
|
||||
if (value.schema != editor.schema) {
|
||||
change
|
||||
.setValue({ schema: editor.schema })
|
||||
.setValue({ schema: editor.schema }, { save: false })
|
||||
.normalize()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user