St.date_input not working in the sidebar on mobile devices / very narrow windows?

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?

I see the issue you’re seeing, and this is a really great bug report. Could you post this at Issues · streamlit/streamlit · GitHub?

I think this is a different issue than the display issue you already linked, and definitely worth posting as a new issue on github.

Done: st.date_input not working in the sidebar on mobile devices or very narrow windows · Issue #8556 · streamlit/streamlit · GitHub

2 Likes

Seems like this bug still exists. Any way to workaround it?

@FFS I would recommend going to adding a :+1: to the bug report that @jgieseler made