瀏覽代碼

Number input float (#1817)

Evan Harley 1 年之前
父節點
當前提交
63ae96ede3
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      reflex/components/forms/numberinput.py

+ 5 - 4
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]