1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

fix normalization for non-node operations

This commit is contained in:
Ian Storm Taylor 2018-09-21 15:01:17 -07:00
parent ca6920a88f
commit 4e9d262f9b

View File

@ -407,6 +407,17 @@ function getDirtyKeys(operation, newValue, oldValue) {
const oldDocument = oldValue.document
switch (type) {
case 'add_mark':
case 'insert_text':
case 'remove_mark':
case 'remove_text':
case 'set_mark':
case 'set_node': {
const target = newDocument.assertNode(path)
const keys = [target.key]
return keys
}
case 'insert_node': {
const table = node.getKeysToPathsTable()
const parent = newDocument.assertParent(path)