How to prevent text inputs and other settings to be wiped out

Currently creating a local Streamlit application that has a set of settings on the left bar and a few input fields on the main page.

I am having a behavior where any change on the settings on the left bar causes the cleaning of all inputs on the main page…

Can this be prevented?

You can add statefulness to your app by using session_state.

I just realized I misread your question.

I am having a behavior where any change on the settings on the left bar causes the cleaning of all inputs on the main page…

Can this be prevented?

Such a behavior is prevented by default. As I said in my other comment, something in your code must be causing it.

Thanks! Will have a look.
But I am also finding weird that a submit form button erases the content of a text input on same form even when clear form is set to false…

Not sure yet why

It doesn’t for me. There must be something in your code (beyond just a form and a text_input) that makes that happen.

1 Like

Thank you. Was able to fix it :slight_smile: