hi guys, basically im having this selectbox and when a option is selected, i wanna hide the select box. so i thought of using this particular code but when i use rerun(), it just gets on a loop… is there any way to fix it ?
Hey @FAtE, there shouldn’t be a need to use st.rerun
here because when you interact with the selectbox widget, the app already reruns. You should be able to access the value of the selectbox by using the key you assigned to it via the session state like st.session_state.user_type_selector
. It should then look something like
if "user_type_selector " not in st.session_state:
selected_option = st.selectbox …
thank you so much for the solution @raethlein , it no more goes on a loop, but then is there any way that i could hide the selectbox widget once a value is chosen ?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.