Skip to content

Extra Spaces showing when using streamlit-aggrid #651

Open
@Abdelgha-4

Description

Here is a minimal code that reproduce the issue:

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

data = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
AgGrid(data)
st.write("test")

with requirements: ["streamlit-aggrid"].

You can see an extra space showing after the aggrid table.
image

However this is very inconsistent, for example if you reduce the page width in the above example, the extra space will disappear.
image

This inconsistency could be seen more when interacting with other streamlit components
For example modifying the above example with:

i = st.selectbox("select", [1, 2, 3])
data = pd.DataFrame({'col1': [i, 2], 'col2': [3, 4]})

You can see that with each change in the select box, the extra space might show or disappear !

Investigation:
By analyzing the html, I can see that the changes occur in the height of the iframe containing the aggrid table.
My guess is that some JS code responsible for setting the Aggrid height gets interrupted by stlite before it runs completly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions