I’m trying to do a super simple app but have some problems.
I have a
text_input and a
Every time that a user inserts a text to the
text_input widget, I
st.write its input.
If he pressed the
button's text (and set the
text_input value to the same as the
The thing is that when the user presses the
button and therefore inserts manual text (through the
text_input), the page seems to be reset and to value comes to the
Here is my code:
import streamlit as st if __name__ == '__main__': input = st.empty() txt = input.text_input("Insert text:") bt = st.button("Text01") if bt: txt = "Text01" input.text_input("Insert text:", value=txt) st.write(txt)
Here is a record of that scenario:
What do I wrong?