Skip to content

Fix fill_height infinite growth with empty footer_links in iframes#4

Open
gambletan wants to merge 1 commit intomainfrom
fix/fill-height-infinite-growth
Open

Fix fill_height infinite growth with empty footer_links in iframes#4
gambletan wants to merge 1 commit intomainfrom
fix/fill-height-infinite-growth

Conversation

@gambletan
Copy link
Copy Markdown
Owner

Summary

  • Fixes "fill_height" makes interface grow to infinite if "footer_links=[]" on Hugging Face. gradio-app/gradio#12992
  • When fill_height=True and footer_links=[], the interface grows infinitely on Hugging Face Spaces
  • Root cause: handle_resize() in Blocks.svelte uses parentIFrame.size() (iframe-resizer) to set the iframe height based on content height. When fill_height=True, the content uses flex-grow: 1 to fill available space. This creates a feedback loop: content fills iframe -> iframe-resizer reads content height and grows iframe -> content fills new height -> repeat forever
  • Fix: Skip the parentIFrame.size() call when fill_height is enabled, since the app is designed to fill available space rather than dictate the iframe size

Test plan

  • Create a Gradio app with fill_height=True and footer_links=[], deploy to HF Spaces, verify it no longer grows infinitely
  • Verify that apps with fill_height=False still resize correctly in iframes
  • Verify that apps with fill_height=True and non-empty footer_links still work correctly

…footer_links in iframes

When fill_height=True and the app runs inside an iframe with iframe-resizer
(e.g., on Hugging Face Spaces), the handle_resize function creates a feedback
loop: the content fills the iframe height (due to fill_height), then
iframe-resizer reads the content height and grows the iframe, which causes
the content to grow again, ad infinitum.

Skip the manual iframe resize when fill_height is enabled, since the app is
intended to fill available space rather than dictate the iframe size.

Fixes gradio-app#12992

Signed-off-by: Tan <alvinttang@gmail.com>
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.

"fill_height" makes interface grow to infinite if "footer_links=[]" on Hugging Face.

1 participant