diff --git a/packages/slate-react/src/plugins/before.js b/packages/slate-react/src/plugins/before.js index af3dd3037..514130384 100644 --- a/packages/slate-react/src/plugins/before.js +++ b/packages/slate-react/src/plugins/before.js @@ -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() } diff --git a/packages/slate/src/changes/on-value.js b/packages/slate/src/changes/on-value.js index 456be8e44..36c969a4c 100644 --- a/packages/slate/src/changes/on-value.js +++ b/packages/slate/src/changes/on-value.js @@ -14,9 +14,10 @@ const Changes = {} * * @param {Change} change * @param {Object|Value} properties + * @param {Object} options */ -Changes.setValue = (change, properties) => { +Changes.setValue = (change, properties, options = {}) => { properties = Value.createProperties(properties) const { value } = change @@ -24,7 +25,7 @@ Changes.setValue = (change, properties) => { type: 'set_value', properties, value, - }) + }, options) } /**