From 48af642e4f731b41b6aae975ea876a32def86fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Proch=C3=A1zka?= Date: Tue, 7 Oct 2025 12:02:21 +0200 Subject: [PATCH] BinaryInputBuilder was a bit fucky wucky without the update handler --- utils.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils.js b/utils.js index d51a7a8..6ffa165 100644 --- a/utils.js +++ b/utils.js @@ -235,11 +235,13 @@ class BinaryInputBuilder { let input = new ElementBuilder("input#" + this.key) .type("checkbox") .checked(this.result[this.key]) - .if(this.update_handler !== null, b => b.on_click(e => { + .on_click(e => { console.log(e.target.checked); this.result[this.key] = e.target.checked; - this.update_handler(e.target.checked); - })) + if(this.update_handler !== null) { + this.update_handler(e.target.checked); + } + }) .finish(); let bundle = new ElementBuilder("div.horizontal-list")