Skip to content

fix: prevent fill_height infinite growth with empty footer_links#13012

Closed
gambletan wants to merge 1 commit intogradio-app:mainfrom
gambletan:fix/fill-height-infinite-grow
Closed

fix: prevent fill_height infinite growth with empty footer_links#13012
gambletan wants to merge 1 commit intogradio-app:mainfrom
gambletan:fix/fill-height-infinite-grow

Conversation

@gambletan
Copy link
Copy Markdown
Contributor

Summary

  • Fixes "fill_height" makes interface grow to infinite if "footer_links=[]" on Hugging Face. #12992fill_height causes infinite vertical growth when footer_links=[] (e.g., on Hugging Face Spaces)
  • Root cause: ResizeObserver calls parentIFrame.size() based on getBoundingClientRect(), which grows the iframe, which triggers another resize via the flex-grow layout — creating an infinite feedback loop
  • When footer is present, it stabilizes the flex layout and prevents the loop; with footer_links=[] the footer is not rendered and nothing constrains growth
  • Fix: skip parentIFrame resizing when fill_height is true, since fill_height semantics mean "fill available space" not "grow the container to fit content"

Test plan

  • Launch a Gradio app with fill_height=True (default for ChatInterface) and footer_links=[] — verify it no longer grows infinitely
  • Launch a Gradio app with fill_height=True and default footer_links — verify normal behavior is preserved
  • Launch a Gradio app with fill_height=False and footer_links=[] — verify iframe resizing still works
  • Test on Hugging Face Spaces to confirm the fix in an iframe context

🤖 Generated with Claude Code

When fill_height is true and the app is embedded in an iframe (e.g.
Hugging Face Spaces), the ResizeObserver triggers parentIFrame.size()
which increases the iframe height, causing the flex-grow container to
expand, which triggers another resize — creating an infinite growth
loop. This only manifests when footer_links=[] because without the
footer element there is nothing to stabilize the flex layout.

Fix: skip parentIFrame resizing when fill_height is true, since
fill_height semantics mean 'fill available space' not 'grow container
to fit content'.

Fixes gradio-app#12992
@freddyaboulton
Copy link
Copy Markdown
Collaborator

Duplicate of #13006

@freddyaboulton freddyaboulton marked this as a duplicate of #13006 Mar 13, 2026
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.

2 participants