Skip to content

Commit

Permalink
Number input float (#1817)
Browse files Browse the repository at this point in the history
  • Loading branch information
raven-black-dream authored Sep 15, 2023
1 parent 796f523 commit 63ae96e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions reflex/components/forms/numberinput.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""A number input component."""

from numbers import Number
from typing import Dict

from reflex.components.component import Component
Expand All @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 63ae96e

Please sign in to comment.