Summary
How to change input_number value to default after clicking st.button?
Steps to reproduce
Example:
Code snippet:
example = st.number_input('Example', min_value=0.0, max_value=1.0,step=0.1, format='%.7f', value=0.0)
if st.button('Reset'):
#I thought that by setting the default parameter to 0.0 in st.number_input, the input field #would be initialized with that value. However, even after changing the value, the old value #is still displayed in the input field, and when I press a button to print the updated value, #the old value is always printed because it is still present in the input field.
#What i want:
#reset value of example to default and changing also the html input value
Explain what you expect to happen when you run the code above.
It should update the hmtl input line and the input value
Debug info
- OS version: Windows