Form and submit button in sidebar

Hi everyone,

I noticed that changing the value of an number_input inside a form, inside the sidebar, triggers a rerun. Is this behaviour avoidable?

with st.sidebar:

    with st.form(key='my_form'):
        input_1 = st.number_input('input_1', min_value=0.0, max_value=1000.0, value=5.0, step=1.0)

        input_2 = st.number_input('input_2', min_value=0.0, max_value=1000.0, value=5.0, step=1.0)

        submit_button = st.form_submit_button(label='Submit parameters')

Hey @dp3456789 and welcome to the forum :wave:

Unfortunately, I wasn’t able to replicate the issue. What version are you on?
Also, does the whole script rerun and does the input value change in Python?

Please tell me more about the issue and I’ll be happy to help you out.
And thanks for using Streamlit!

2 Likes