Skip to content

[BUG] st.sidebar breaks configure_grid_options(domLayout='autoHeight') #337

Description

@cjw296

Describe the bug

When a st.sidebar is used, autoHeight results in the table just being clipped, rather than all rows being shown:

Image

To Reproduce
Run the attached reproducer.py.

reproducer.py

Expected behavior

If you apply this diff, autoheight works as expected:

index c3c55b7..cfcb156 100644
--- a/notebooks/reproducer.py
+++ b/notebooks/reproducer.py
@@ -5,13 +5,12 @@ import streamlit as st
 import pandas as pd
 from st_aggrid import AgGrid, GridOptionsBuilder
 
-# Sidebar controls
-num_rows = st.sidebar.slider("Number of rows", 5, 100, 30)
-use_autoheight = st.sidebar.checkbox("Enable Auto-Height (domLayout='autoHeight')", value=True)
-
-# Main content
 st.title("AgGrid Auto-Height Test")
 
+# Controls
+num_rows = st.slider("Number of rows", 5, 100, 30)
+use_autoheight = st.checkbox("Enable Auto-Height (domLayout='autoHeight')", value=True)
+
 # Generate data
 df = pd.DataFrame({
     'ID': range(1, num_rows + 1),

This is with:

├── streamlit v1.48.1
├── streamlit-aggrid v1.1.8

Metadata

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