Selectbox not working as expected in 1.56.0

Been using Streamlit for a what-if tool for our Finance team. Its been working good.

The tool has lot of scenarios that people could play around. For e.g. There is a widget for Tourism where the user can select one of the following options “5% more than last year, 10% lesser than last year, 2020 returns, 2021 returns, ….” etc. It used to work well and all good.

I updated to 1.56.0 and the values selected were reflecting in the display… but underneath the code wasnt running as expected. The changes were not reflecting on the financial metrics.

I moved back to 1.50 and everything came back to normal.

I dont have a repro case now. I will prepare one later.

But, just want to ask the community:

How has 1.56 been for all of you?

Hey there, thanks for sharing your experience and for being part of the Streamlit community! :blush: It’s great to hear your what-if tool has been helpful for your Finance team. Regarding your issue after upgrading to Streamlit 1.56.0: there have been significant changes to widget identity and state management in recent releases, especially with widgets now relying more on their key for identity rather than their parameters. This can cause unexpected behavior if your widgets’ keys or parameters change between reruns, or if you rely on parameter-based identity instead of explicit keys.

If you noticed that widget selections appeared correct in the UI but didn’t trigger updates in your calculations, it’s likely related to these changes in widget state handling. The release notes for recent versions highlight that widgets like st.pills and st.segmented_control now use only their key for identity, and similar transitions are happening for other widgets, which may affect how state updates propagate in your app. Rolling back to 1.50 would restore the previous behavior, as you’ve seen. If you can, please share a minimal reproducible example when you have time—this helps the community and devs pinpoint the issue faster! For now, you can check the release notes for more details and see if any changes match your scenario.

Sources: