-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
feature:st.sidebarRelated to `st.sidebar` containerRelated to `st.sidebar` containerpriority:P1High priority - fix within two weeksHigh priority - fix within two weeksstatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expected
Description
Checklist
- I have searched the existing issues for similar issues.
- I added a very descriptive title to this issue.
- I have provided sufficient information below to help reproduce this issue.
Summary
When zooming in or out (Cmd +/Cmd -), the sidebar resets to its initial state. If there is no st.set_page_config, then the sidebar always reopens on zoom. If there is st.set_page_config(initial_sidebar_state="collapsed"), the the sidebar always collapses on zoom.
Reproducible Code Example
import streamlit as st
import pandas as pd
# st.set_page_config(initial_sidebar_state="collapsed")
st.title('Guess who?')
st.text_input('First name')
st.text_input('Last name')
st.sidebar.selectbox('Select a demo', ['','A','B'])Steps To Reproduce
- Run the app.
- Close the sidebar
- Zoom in, or resize the window. (Sidebar reopens)
Expected Behavior
Zooming in or out shouldn't change the state of elements (except maybe some edge case where the change in zoom changes some boundary condition).
Current Behavior
The sidebar resets to its initial state on zoom and more generally on any resize event.
Is this a regression?
- Yes, this used to work in a previous version.
Debug info
- Streamlit version: 1.47.0
- Python version: 3.13
- Operating System: Mac
- Browser: Prisma
Additional Information
I was testing an old issue (#6916) to see if it had resolved with all the sidebar/theming/navigation changes, but I can't carry out the steps to reproduce the old bug because the sidebar resets its state when zooming in or out.
github-actions and ivan-schinella
Metadata
Metadata
Assignees
Labels
feature:st.sidebarRelated to `st.sidebar` containerRelated to `st.sidebar` containerpriority:P1High priority - fix within two weeksHigh priority - fix within two weeksstatus:confirmedBug has been confirmed by the Streamlit teamBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedSomething isn't working as expected