From 887d73edae71fd7f6fa7ce25384ec1c297182d21 Mon Sep 17 00:00:00 2001 From: Won-Kyu Park Date: Sun, 15 Oct 2023 17:47:02 +0900 Subject: [PATCH] fix #33 issue --- javascript/active.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/javascript/active.js b/javascript/active.js index 042a892..6c0fb5b 100644 --- a/javascript/active.js +++ b/javascript/active.js @@ -30,6 +30,13 @@ onUiUpdate(() => { e.stopPropagation(); }); + span.addEventListener('click', (e) => { + checkbox.checked = !checkbox.checked; + badge.checked = checkbox.checked; + triggerEvent(checkbox, 'change'); + e.stopPropagation(); + }); + badge.className = checkbox.className; badge.classList.add('primary'); span.insertBefore(badge, span.firstChild);