Closed sametsoekel closed 11 months ago
Hey @sametsoekel!
Sorry for the late answer.
To make it work within a form, you should use the with:
notation instead of calling with the streamlit namespace. Indeed, the date_range_picker
is not part of the official streamlit namespace.
import streamlit as st
from streamlit_extras.mandatory_date_range import date_range_picker
form = st.form(key="foo")
form.selectbox("Bar", list("abcd"))
with form: # <- see this
date_range_picker("Select a date range")
form.form_submit_button()
But to be fair, the behavior won't be ideal when used in a form, see demo:
Description
Hi,
Works like a charm in the standalone way, but couldn't make it happen in st.form()
Reproduction steps
Screenshots
Logs
No response
Version of streamlit
1.20.0
Version of streamlit-extras
0.3.0