From d7c1da6c2b5970aff18a31dd468ab4ae7a27232f Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 10 Apr 2019 20:08:33 +0000 Subject: [PATCH] Adding/removing inputs updates answer --- example-puzzles/example/5/helpers.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/example-puzzles/example/5/helpers.js b/example-puzzles/example/5/helpers.js index 946e8e2..603b92e 100644 --- a/example-puzzles/example/5/helpers.js +++ b/example-puzzles/example/5/helpers.js @@ -38,7 +38,11 @@ function helperUpdateAnswer(event) { function helperRemoveInput(e) { let item = e.target.parentElement + let container = item.parentElement item.remove() + + var event = new Event("input") + container.dispatchEvent(event) } function helperExpandInputs(e) { @@ -58,6 +62,9 @@ function helperExpandInputs(e) { newElement.querySelector("input").value = "" container.insertBefore(newElement, item) + + var event = new Event("input") + container.dispatchEvent(event) } function helperActivate(e) {