Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redrawable types should be documented #88

Closed
monchier opened this issue Oct 30, 2019 · 2 comments
Closed

Redrawable types should be documented #88

monchier opened this issue Oct 30, 2019 · 2 comments

Comments

@monchier
Copy link
Collaborator

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.

@randyzwitch randyzwitch transferred this issue from streamlit/streamlit Oct 14, 2021
@snehankekre
Copy link
Collaborator

snehankekre commented Nov 22, 2021

Closing this issue as it has not come up since 2019. Obviously, if people start mentioning this again, we can add a note to the docs.

@ivanmkc
Copy link

ivanmkc commented Jul 20, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants