diff --git a/list-editor/index.js b/list-editor/index.js index d9b3579..e20a214 100644 --- a/list-editor/index.js +++ b/list-editor/index.js @@ -490,21 +490,9 @@ function editor(root, inputData, options) { trigger('change') - // disableDragging(drake) - // render(root, store); - // drake = enableDragging(root) - return false }); - $(root).on('keydown', '.input-line', function (event) { - if (event.key === 'Escape') { - stopEditing(root, store, $(this)) - return false - } - return true - }); - function moveCursor(event, dir) { let target = event.target; diff --git a/list-editor/store.js b/list-editor/store.js index 980407a..6c96df1 100644 --- a/list-editor/store.js +++ b/list-editor/store.js @@ -199,7 +199,7 @@ function Store(inputData) { let index = _.findIndex(idList, (id) => id === currentId) let oldValue = _.clone(values[currentId]) let newValue = callback(values[currentId], values[idList[index - 1]], values[idList[index + 1]]); - if (oldValue && oldValue.text !== newValue.text) { + if (!oldValue || oldValue.text !== newValue.text) { values[currentId] = newValue changed = true }