Summary
Hi,
I would like to have two columns.
One column with text and button and the second column contains set of selectbox widgets.
Once clicking on the button the set of selectbox is created (dynamic number of widgets).
I tried to implement it straight forward by adding the selectbox under the button selection however it make the selectbox to disappear once selecting an option
Steps to reproduce
Code snippet:
def build_col2(calibration_properties):
with col2:
st.markdown("Which attributes you would like to use for calibration?")
option = {}
for calibration_property in calibration_properties:
option[calibration_property["property_name"]] = st.selectbox(
calibration_property["property_name"],
calibration_property["property_options"],
label_visibility=st.session_state.visibility,
disabled=st.session_state.disabled,
)
if "property_name" in calibration_property:
st.write('You selected:', option[calibration_property["property_name"]])
if st.button("Calibrate", type="primary"):
print("You selected")
if st.button("Prepare calibration", type="primary"):
calibration_properties = handle_build_calibration_properties(user_question)
print("calibration_properties " + str(calibration_properties[0]))
build_col2(calibration_properties)
Expected behavior:
Selectbox list is being updated and fully functional
Actual behavior:
Selectedbox is updated however once selecting an element the selectbox is disappering
Debug info
- Streamlit, version 1.26.0
- Python 3.11.4
- Using Conda? PipEnv? PyEnv? Pex? No
- OS version: MaxOS
- Browser version: Chrome
thank you