From 9295fafd618f20023022dc996e385a3e437b7247 Mon Sep 17 00:00:00 2001 From: Morris Brodersen Date: Tue, 27 Oct 2020 17:03:45 +0100 Subject: [PATCH] fix #4 --- public/scripts/TodoItemInput.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/scripts/TodoItemInput.js b/public/scripts/TodoItemInput.js index f28fbdb..4696d2f 100644 --- a/public/scripts/TodoItemInput.js +++ b/public/scripts/TodoItemInput.js @@ -46,14 +46,14 @@ VT.TodoItemInput = function (el) { if (label === '') return; + inputEl.value = ''; + el.dispatchEvent( new CustomEvent('addItem', { - detail: { label: inputEl.value }, + detail: { label: label }, bubbles: true, }) ); - - inputEl.value = ''; } function clear() {