]> git.proxmox.com Git - ui/proxmox-yew-widget-toolkit.git/commitdiff
Boolean: fix disabled flag
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 31 Jan 2024 12:21:52 +0000 (13:21 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 31 Jan 2024 12:21:52 +0000 (13:21 +0100)
src/widget/form/boolean.rs

index d9ece90cc42a7e58063d3ff47067be6256515c7f..95fb1357e9b1d68de99c8f34808741a13692695a 100644 (file)
@@ -165,6 +165,9 @@ impl ManagedField for BooleanField {
         let state = ctx.state();
         match msg {
             Msg::Toggle => {
+                if props.input_props.disabled {
+                    return true;
+                }
                 let checked = state.value.as_bool().unwrap_or(false);
                 let new_checked = !checked;
                 ctx.link().update_value(new_checked);