From 63ae96ede378e8e77e097bdf2d05c94e16a6467f Mon Sep 17 00:00:00 2001 From: Evan Harley Date: Fri, 15 Sep 2023 09:58:33 -0700 Subject: [PATCH] Number input float (#1817) --- reflex/components/forms/numberinput.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reflex/components/forms/numberinput.py b/reflex/components/forms/numberinput.py index d3a08f4098..c5a15ff72b 100644 --- a/reflex/components/forms/numberinput.py +++ b/reflex/components/forms/numberinput.py @@ -1,5 +1,6 @@ """A number input component.""" +from numbers import Number from typing import Dict from reflex.components.component import Component @@ -14,7 +15,7 @@ class NumberInput(ChakraComponent): tag = "NumberInput" # State var to bind the input. - value: Var[int] + value: Var[Number] # If true, the input's value will change based on mouse wheel. allow_mouse_wheel: Var[bool] @@ -23,7 +24,7 @@ class NumberInput(ChakraComponent): clamped_value_on_blur: Var[bool] # The initial value of the counter. Should be less than max and greater than min - default_value: Var[int] + default_value: Var[Number] # The border color when the input is invalid. error_border_color: Var[str] @@ -56,10 +57,10 @@ class NumberInput(ChakraComponent): keep_within_range: Var[bool] # The maximum value of the counter - max_: Var[int] + max_: Var[Number] # The minimum value of the counter - min_: Var[int] + min_: Var[Number] # "outline" | "filled" | "flushed" | "unstyled" variant: Var[str]