From 4d60dbb6efe2ac318ae6f549691107c2d2f9ff5c Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sat, 23 Jul 2022 20:59:38 +0200 Subject: don't add empty tags --- fietsboek/static/fietsboek.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fietsboek/static/fietsboek.js b/fietsboek/static/fietsboek.js index d58da60..265032e 100644 --- a/fietsboek/static/fietsboek.js +++ b/fietsboek/static/fietsboek.js @@ -26,6 +26,9 @@ addHandler(".tag-badge", "click", tagClicked); */ function addTag() { const newTag = document.querySelector("#new-tag"); + if (newTag.value === "") { + return; + } const node = document.createElement("span"); node.classList.add("tag-badge"); node.classList.add("badge"); -- cgit v1.2.3