diff --git a/app/ui/selectbox.js b/app/ui/selectbox.js index cf1d1a4f..ce3e3ef8 100644 --- a/app/ui/selectbox.js +++ b/app/ui/selectbox.js @@ -1,32 +1,28 @@ const html = require('choo/html'); module.exports = function(selected, options, translate, changed, htmlId) { - let x = selected; - + function choose(event) { + if (event.target.value != selected) { + console.log('Selected new value from dropdown', htmlId, ':', selected, '->', event.target.value) + changed(event.target.value); + } + } + return html` `; - - function choose(event) { - const target = event.target; - const value = +target.value; - - if (x !== value) { - x = value; - changed(value); - } - } };