Since some recent time, st. date_input is not working anymore when it is put in the sidebar (e.g., st.sidebar.date_input()
) and the streamlit app is either run on a mobile device or with a very narrow browser window (the important point is that the app width is so small that the sidebar is automatically hidden). In these cases, opening the sidebar first, then the st. date_input, and then trying to change the month or the year results in the whole sidebar being collapsed again, rendering the input method unusable.
The problem occurs when streamlit is run locally (with the latest version 1.33.0) or in the cloud. See example code at streamlit_bug/streamlit_app.py at main · jgieseler/streamlit_bug · GitHub and corresponding app at https://datepicker-bug.streamlit.app
To reproduce the bug:
- Open app at https://datepicker-bug.streamlit.app (or locally)
- Reduce browser window width until the sidebar is automatically hidden (not needed when opening with mobile device)
- Open sidebar by clicking on the
>
in the top left - Click on the date picker
- Click on the month or year to change it
- The sidebar will collapse
I’m not sure if this problem is connected to date_input on sidebar has a display issue · Issue #6107 · streamlit/streamlit · GitHub
Anyone else noticed this behavior and maybe has a workaround at hand?