I am new to streamlit and I am trying to reset the select box to the original state once there is a change in the multiselect options. Below is the code I am using:
text = st.sidebar.selectbox( options=["", "text1", "text2"], format_func=lambda x: "Select a text" if x == "" else x, ) def multiselect_on_change(): text = None multi_select = st.multiselect( "Choose an option", ["option1", "option2", "option3", "option4"], ["option1"], on_change=multiselect_on_change )
Now in the start,
Select a text and I am selecting
multiselect and then do something. After this, I am removing
option1 from the
multiselect through the UI and now I want to reset
Select a text.
Is there any way I can achieve this? Thanks in advance for any help.