You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue where I update a variable that changes which container is drawn:
if self.view_model.mode == "A":
with st.container():
st.header("A")
next_button_tapped = st.button("Go to b")
if next_button_tapped:
self.view_model.mode = "B"
elif self.view_model.mode == "B":
with st.container():
st.header("B")
next_button_tapped = st.button("Go to A")
if next_button_tapped:
self.view_model.mode = "A"
The problem is that the mode attribute is updated after the "redraw", so I have to it only works if I tap the button "twice". Once to set it, and once to redraw. Even then, the UI and state are out of sync.
Related to this: https://discuss.streamlit.io/t/force-redraw-of-an-earlier-element/635
Please add documentation of which types in
DeltaGenerator
are redrawable.The text was updated successfully, but these errors were encountered: