]> git.proxmox.com Git - ui/proxmox-yew-widget-toolkit.git/commitdiff
widget: boolean: make clickable area react to clicks
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 24 Sep 2024 13:14:45 +0000 (15:14 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 26 Sep 2024 07:04:00 +0000 (09:04 +0200)
same as for the checkbox field in commit:
a3361fc (widget: checkbox: make clickable area react to clicks)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/widget/form/boolean.rs

index 95fb1357e9b1d68de99c8f34808741a13692695a..ad4b4380c2edad7d6d5004874b7cc764a109853b 100644 (file)
@@ -248,8 +248,7 @@ impl ManagedField for BooleanField {
             )
             .attribute("role", "checkbox")
             .attribute("aria-checked", checked.then(|| "true"))
-            .onkeyup(onkeyup)
-            .onclick(onclick);
+            .onkeyup(onkeyup);
 
         if let Err(msg) = &valid {
             checkbox.set_tip(msg.clone())
@@ -260,10 +259,11 @@ impl ManagedField for BooleanField {
         }
 
         if props.switch {
-            checkbox.into()
+            checkbox.onclick(onclick).into()
         } else {
             Container::new()
                 .class("pwt-checkbox-state")
+                .onclick(onclick)
                 .with_child(checkbox)
                 .into()
         }