From 5000ab768a8db74f23a4928aa9535baa9747326e Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 7 Aug 2021 23:04:01 +0200 Subject: [PATCH] Reset ids when pasting new lines --- list-editor/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/list-editor/index.js b/list-editor/index.js index 5b6d4bc..bfff6b5 100644 --- a/list-editor/index.js +++ b/list-editor/index.js @@ -496,6 +496,11 @@ function editor(root, inputData, options) { let item = $(this).parents('.list-item') let id = item.attr('data-id') + // reset ids + _.each(items, item => { + item.id = null + }) + store.insertAfter(id, ...items) trigger('change')