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

Make blocks stale-able and fix emotion warning #2333

Merged
merged 1 commit into from Nov 11, 2020

Conversation

karriebear
Copy link
Contributor

Issue: Fixes #2291

Description: Previously only elements can be stale. The expander header is part of the block and is therefore not rendered with the element logic.

  1. Removing the check to see if the node is an element.
  2. Applying stale-element to expander header if the block is stale

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@karriebear karriebear requested a review from a team November 10, 2020 20:55
Copy link
Contributor

@akrolsmir akrolsmir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Tested on PR Preview, by rerunning this snippet twice:

import streamlit as st
import time

time.sleep(3)

container = st.beta_container()
container.write("I cannot collapse")

expander = st.beta_expander("Collapse me!", expanded=True)
expander.write("I can collapse")

collapsed = st.beta_expander("Expand me!")
collapsed.write("I am already collapsed")

sidebar = st.sidebar.beta_expander("Expand me!")
sidebar.write("I am in the sidebar")

@karriebear karriebear merged commit fd6d99e into streamlit:develop Nov 11, 2020
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

Successfully merging this pull request may close these issues.

st.expander doesn't fade when app is rerunning
2 participants