From bc676088a551888bcc2766e217b893bccab0c266 Mon Sep 17 00:00:00 2001 From: Domas Date: Mon, 2 Jan 2023 12:34:46 +0000 Subject: [PATCH] Delay removing last item on enter to give time for editor.js event to be emitted --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index fd2babcf..28489d43 100644 --- a/src/index.js +++ b/src/index.js @@ -577,7 +577,9 @@ export default class NestedList { * @returns {void} */ getOutOfList() { - this.currentItem.remove(); + setTimeout(function() { + this.currentItem.remove(); + }, 0) this.api.blocks.insert(); this.api.caret.setToBlock(this.api.blocks.getCurrentBlockIndex());