Summary
st.file_uploader reruns the complete app and returns to main page after file uploads
Steps to reproduce
Code snippet:
Below func1 is called from another page having multiple tabs built using st.tabs
def func1():
# st.text_input(label="Enter File Name")
# st.text_input(label="Enter Text Column Name")
with st.form('Form1'):
uploaded_file = st.file_uploader("Please choose an Excel or CSV file for Labelling", type=['xlsx', 'csv'])
submitted1 = st.form_submit_button('Submit 1')
st.write(submitted1)
if submitted1:
if uploaded_file is not None:
data = pd.read_excel(uploaded_file)
st.write(data[3])```
If applicable, please provide the steps we should take to reproduce the error or specified behavior.
**Expected behavior:**
Explain what you expect to happen when you run the code above.
Expected behavior is that file content is read by further code for processing of data
**Actual behavior:**
application is re running and returning to login page
Explain the undesired behavior or error you see when you run the code above.
If you're seeing an error message, share the full contents of the error message here.
### Debug info
- Streamlit version:1.25
- Python version:3.9