From 46381fd516b06202cace16ddb6bc7c45d2085025 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 19 May 2021 00:35:53 -0400 Subject: [PATCH] Fix glitchy UI dropdown select for max downloads and expiration --- app/ui/selectbox.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) 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); - } - } };