I’m trying to get the current, selected value of a selectbox. No matter what I do, when I call the value in the on_change function, it shows the previous value instead of the selected value. What’s up with that?
st.selectbox will return the new value in the next rerun, but the callback is called before that, so it will see the old value. In order to access the new value in the callback, assign a key to the widget and look it up in session_state.