Combination of Drop-down menu (st.selectbox) with a Button (st.Button) to control execution flow doesn't work đź’Ą

What you need is this:

That is, store the button pressed state in a session state and use that for your further steps (say step-3).

The problem occurs because when you press a button in step-2, it will be marked as true only during the first refresh. When you change anything beyond that, the subsequent refresh will return false for the button pressed state.

2 Likes