Widget behavior: a notable bugfix in Streamlit 1.27 and a new guide in docs

I’d like to draw special attention to a bugfix in 1.27.0 that may cause some confusion:

Blockquote
:spider: Bug fix: Identical widgets on different pages are correctly interpreted by Streamlit as distinct (#7264 , #6146 ).

Although it may cause confusion at times (and we’re actively discussing modifications to the behavior), Streamlit does not retain widget state between pages. Widgets will reset if you change any of their defining parameters (label, min or max value, default value, placeholder text, help text, etc). Widgets also reset if you change pages, even if you keep all other parameters for the widget the same.

I’ve written a new guide to dive into how widgets work and how to work around this expected behavior. We are also collecting feedback in GitHub.

2 Likes