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

Aggrid element sometime not displaying with multiple expanders #248

Open
brian-noble-ai opened this issue Feb 8, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@brian-noble-ai
Copy link

I have an app that has multiple pages, each of which has an Aggrid element hidden inside an expander. If I switch between pages and expand these, I find the Aggrid element often doesn’t display unless I manually rerun the page. I tried to make a minimal example here, using a toggle to simulate multiple pages. (the “working example” can be commented out, it’s just to show what’s necessary to reproduce the issue). I'm using streamlit version 1.30.0 and streamlit-aggrid version 0.3.4.post3

import streamlit as st
from st_aggrid import AgGrid
import pandas as pd

data = {
    'System Name': ['System A', 'System B', 'System C', 'System D'],
    'Value 1': [10, 20, 30, 40],
    'Value 2': [1, 2, 3, 4]
}
df = pd.DataFrame(data)

# this works 
if st.toggle("Expander and non-expander"):
    st.write("some text (toggle on)")
else:
    with st.expander("Expand (toggle off)"):
        AgGrid(df, key="aggrid1")

# this breaks - aggrid element often won't appear when expanded
if st.toggle("Expander and expander"):
    with st.expander("Expand (toggle off)"):
        AgGrid(df, key="aggrid2")
else:
    with st.expander("Expand (toggle on)"):
        st.write("some text (toggle on)")
@PablocFonseca PablocFonseca added the bug Something isn't working label Mar 21, 2024
@PablocFonseca PablocFonseca self-assigned this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants