Skip to content

Commit

Permalink
InputNumber’s min & max are now OptMaybeSignal
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentberthier committed Mar 7, 2024
1 parent 8a79817 commit 920c3e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions leptonic/src/components/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ pub fn PasswordInput(
pub fn NumberInput(
#[prop(into)] get: MaybeSignal<f64>,
#[prop(into, optional)] set: Option<Out<f64>>,
#[prop(optional)] min: Option<f64>,
#[prop(optional)] max: Option<f64>,
#[prop(optional)] min: OptMaybeSignal<f64>,
#[prop(optional)] max: OptMaybeSignal<f64>,
#[prop(optional, into)] step: OptMaybeSignal<f64>,
#[prop(optional, into)] placeholder: OptMaybeSignal<String>,
#[prop(optional, into)] prepend: OptMaybeSignal<View>,
Expand Down Expand Up @@ -233,8 +233,8 @@ pub fn NumberInput(
None => leptos::Oco::from(""),
}
type="number"
min=min
max=max
min=move || min.0.as_ref().map(SignalGet::get).unwrap_or(0.0)
max=move || max.0.as_ref().map(SignalGet::get).unwrap_or(0.0)
step=move || step.0.as_ref().map(SignalGet::get).unwrap_or(0.0)
prop:disabled=move || disabled.0.as_ref().map(SignalGet::get).unwrap_or(false)
prop:value=move || get.get()
Expand Down

0 comments on commit 920c3e9

Please sign in to comment.