Avoid triggering full app update when adjusting component height

Hi there, I maintain a streamlit component called ITables (which BTW I would like to see in the components gallery :wink: - not sure how one can achieve that??).

My component works well, however there is one thing that I have not been able to fix, which is updating the iframe height when the component height changes. The easiest way to trigger a height change is but entering text in the search box - the table will show fewer lines, but the component height remains unchanged.

That’s a problem as some actions on the table can make it bigger, e.g. if the user chooses to display more rows per page.

I have tried to call Streamlit.setFrameHeight() when my table component is redrawn but then the Streamlit app gets continuously updated, and I loose the table state.

I see that this precise issue was discussed previously at Disqus integration - #6 by okld and that the corresponding GitHub issue Do not re-render components on frame height change · Issue #1525 · streamlit/streamlit · GitHub was closed, however I still encounter the exact same problem.

Would anyone have indications on how to address this?

Also I am keep track of this issue in my own project tracker at Tables in a Streamlit app have a fixed height that does not work well with lengthMenu or search extensions · Issue #275 · mwouts/itables · GitHub

Thanks!

Hello, I noticed that in my case the execution of streamlit only retriggers when I enlarge or reduce the window.

Moreover, im interested for sort the table with your component

have u try this ?

from itables import to_html_datatable
from streamlit.components.v1 import html

html(
to_html_datatable(
df,
layout={“top1”: “searchPanes”},
searchPanes={“layout”: “columns-3”, “cascadePanes”: True},
),
height=960, # adjust manually
)

Thanks @atha for your proposal - actually you’re pointing me back to the proposed workaround in my own documentation :wink:

Here I guess my question is more addressed to the Streamlit developers - do they propose a way to resize the iframe that contains a component, without triggering an infinite loop of updates?