Adding/removing inputs updates answer

This commit is contained in:
Neale Pickett 2019-04-10 20:08:33 +00:00
parent 53a299d635
commit d7c1da6c2b
1 changed files with 7 additions and 0 deletions

View File

@ -38,7 +38,11 @@ function helperUpdateAnswer(event) {
function helperRemoveInput(e) { function helperRemoveInput(e) {
let item = e.target.parentElement let item = e.target.parentElement
let container = item.parentElement
item.remove() item.remove()
var event = new Event("input")
container.dispatchEvent(event)
} }
function helperExpandInputs(e) { function helperExpandInputs(e) {
@ -58,6 +62,9 @@ function helperExpandInputs(e) {
newElement.querySelector("input").value = "" newElement.querySelector("input").value = ""
container.insertBefore(newElement, item) container.insertBefore(newElement, item)
var event = new Event("input")
container.dispatchEvent(event)
} }
function helperActivate(e) { function helperActivate(e) {