1
0
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:
Yifeng Wang
2017-10-30 11:58:38 -05:00
committed by Ian Storm Taylor
parent d0172eac17
commit e29caf46ec
2 changed files with 5 additions and 3 deletions

View File

@@ -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()
}