reflex
reflex copied to clipboard
number_input component's on_change event handler sets the state variable as string
Describe the bug Looks like the on_change event handler of number_input component sets the state variable as string instead of int.
min_yield <class 'int'> 50
wait - compiling /...
event - compiled client and server successfully in 270 ms (853 modules)
min_yield <class 'int'> 50
min_yield <class 'int'> 50
<<<< The value is updated in the UI
min_yield <class 'str'> 51
File "[REDACTED]app.py", line 36, in df
(df['y'] > self.min_yield / 10)
TypeError: unsupported operand type(s) for /: 'str' and 'int'
To Reproduce Steps to reproduce the behavior:
- Code/Link to Repo:
Expected behavior The event handler should set the state variable as int.
Screenshots If applicable, add screenshots to help explain your problem.
** Specifics (please complete the following information):**
- Python Version: 3.9.13
- Pynecone Version: 0.1.13
- OS: MacOS
- Browser (Optional): Firefox
Additional context Add any other context about the problem here.
Got it seems to be converting to a string will fix. Thanks for pointing this out
Found what's causing this will need to upgrade chakra version seem to be an issue with there lib