From 252d877f1cf57f6598688d7f13b1f82ee0c16abb Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Thu, 29 Oct 2020 23:13:57 +0100 Subject: [PATCH] Use the element itself instead of one earlier --- list-editor/store.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/list-editor/store.js b/list-editor/store.js index 1ed3b87..1c1ecd2 100644 --- a/list-editor/store.js +++ b/list-editor/store.js @@ -116,8 +116,7 @@ function Store(inputData) { */ function insertBefore(beforeId, item) { let index = _.findIndex(idList, (id) => id === beforeId) - let indent = values[idList[index - 1]].indented - item.indented = indent + item.indented = values[idList[index]].indented let id = item.id if (!id) { let newId = ID()