From 97263ec80ddf8a336e8a40d6de08109bf57923f9 Mon Sep 17 00:00:00 2001 From: luoxiao Date: Wed, 22 May 2024 23:17:27 +0800 Subject: [PATCH] feat: SpinButton disabled --- demo_markdown/docs/spin_button/mod.md | 22 +++++++++++++++++++- thaw/src/spin_button/mod.rs | 7 +++++-- thaw/src/spin_button/spin-button.css | 30 +++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/demo_markdown/docs/spin_button/mod.md b/demo_markdown/docs/spin_button/mod.md index 8204702..1374443 100644 --- a/demo_markdown/docs/spin_button/mod.md +++ b/demo_markdown/docs/spin_button/mod.md @@ -7,7 +7,27 @@ let value_f64 = RwSignal::new(0.0); view! { - + } +``` + +### Min / Max + +```rust demo +let value = RwSignal::new(0); + +view! { + +} +``` + +### Disabled + +```rust demo +let value = RwSignal::new(0); + +view! { + +} ``` \ No newline at end of file diff --git a/thaw/src/spin_button/mod.rs b/thaw/src/spin_button/mod.rs index e6aa277..41d068d 100644 --- a/thaw/src/spin_button/mod.rs +++ b/thaw/src/spin_button/mod.rs @@ -48,12 +48,13 @@ where } }; - let increment_disabled = Memo::new(move |_| disabled.get() || value.get() <= min.get()); - let decrement_disabled = Memo::new(move |_| disabled.get() || value.get() >= max.get()); + let increment_disabled = Memo::new(move |_| disabled.get() || value.get() >= max.get()); + let decrement_disabled = Memo::new(move |_| disabled.get() || value.get() <= min.get()); view! {