diff --git a/frontend/static/js/index.js b/frontend/static/js/index.js index 5fae1fd..a6d48e9 100644 --- a/frontend/static/js/index.js +++ b/frontend/static/js/index.js @@ -14,7 +14,7 @@ input.placeholder = "Enter your option here"; optionEl.appendChild(input); - input.addEventListener("keydown", () => { + input.addEventListener("keyup", () => { if (inputList.every(el => el.value) && pollOptionsAnchor) pollOptionsAnchor.appendChild(createPollOptionInput()); }); inputList.push(input); @@ -23,7 +23,7 @@ } pollOptionsAnchor.querySelectorAll(".poll-option input").forEach(el => { - el.addEventListener("keydown", () => { + el.addEventListener("keyup", () => { if (inputList.every(el => el.value) && pollOptionsAnchor) pollOptionsAnchor.appendChild(createPollOptionInput()); }); inputList.push(el);