Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st.date_input not working in the sidebar on mobile devices or very narrow windows #8556

Open
4 tasks done
jgieseler opened this issue Apr 23, 2024 · 2 comments
Open
4 tasks done
Labels
feature:st.date_input priority:P3 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working

Comments

@jgieseler
Copy link

jgieseler commented Apr 23, 2024

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

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.

Reproducible Code Example

import datetime
import streamlit as st

d = st.sidebar.date_input("When's your birthday", datetime.date(2019, 7, 6))
st.write('Your birthday is:', d)

Steps To Reproduce

  • 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

Expected Behavior

A dropdown menu opens from which month or year can be selected.

Current Behavior

The sidebar collapses and the dropdown menu is 'floating in the air'.

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.33.0
  • Python version: 3.9.18
  • Operating System: Ubuntu 22.04
  • Browser: Chromium Version 124.0.6367.60 (Official Build) (64-bit), Firefox 125.0.2 (64-bit)

Additional Information

Maybe connected to #6107

@jgieseler jgieseler added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels Apr 23, 2024
Copy link

If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.

Your feedback helps us prioritize which bugs to investigate and address first.

Visits

@LukasMasuch LukasMasuch added feature:st.date_input status:confirmed Bug has been confirmed by the Streamlit team priority:P3 and removed status:needs-triage Has not been triaged by the Streamlit team labels Apr 26, 2024
@LukasMasuch
Copy link
Collaborator

@jgieseler Thanks for reporting this issue 👍 I was able to reproduce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.date_input priority:P3 status:confirmed Bug has been confirmed by the Streamlit team type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants