Skip to content

fix: skip iframe resize when fill_height is true#13014

Closed
wavebyrd wants to merge 1 commit intogradio-app:mainfrom
wavebyrd:fix/fill-height-iframe-infinite-growth
Closed

fix: skip iframe resize when fill_height is true#13014
wavebyrd wants to merge 1 commit intogradio-app:mainfrom
wavebyrd:fix/fill-height-iframe-infinite-growth

Conversation

@wavebyrd
Copy link
Copy Markdown

Summary

  • Fixes "fill_height" makes interface grow to infinite if "footer_links=[]" on Hugging Face. #12992
  • When fill_height=True (default for ChatInterface) and footer_links=[], the interface grows infinitely on HuggingFace Spaces
  • Root cause: ResizeObserver fires parentIFrame.size() based on getBoundingClientRect(), which grows the iframe, which triggers flex layout to fill the new space, which fires the observer again -- a feedback loop. The footer normally breaks this cycle, but with no footer nothing constrains it.
  • 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 with fill_height=True and footer_links=[] -- should no longer grow infinitely
  • Launch with fill_height=True and default footer_links -- normal behavior preserved
  • Launch with fill_height=False and footer_links=[] -- iframe resizing still works

…growth

When fill_height is enabled (default for ChatInterface), the
ResizeObserver calls parentIFrame.size() based on content height.
This creates a feedback loop: the iframe grows, flex layout fills
the new space, the observer fires again, and the iframe grows more.
The footer normally breaks this cycle, but with footer_links=[]
no footer renders and nothing stops the loop.

Since fill_height means "fill available space" rather than "grow
to fit content," the correct behavior is to skip parentIFrame
resizing entirely when fill_height is true.

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
@wavebyrd
Copy link
Copy Markdown
Author

Ping on this fill_height iframe fix. Ready for review!

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