fix: prevent fill_height infinite growth with empty footer_links#13012
Closed
gambletan wants to merge 1 commit intogradio-app:mainfrom
Closed
fix: prevent fill_height infinite growth with empty footer_links#13012gambletan wants to merge 1 commit intogradio-app:mainfrom
gambletan wants to merge 1 commit intogradio-app:mainfrom
Conversation
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
Collaborator
|
Duplicate of #13006 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fill_heightcauses infinite vertical growth whenfooter_links=[](e.g., on Hugging Face Spaces)ResizeObservercallsparentIFrame.size()based ongetBoundingClientRect(), which grows the iframe, which triggers another resize via the flex-grow layout — creating an infinite feedback loopfooter_links=[]the footer is not rendered and nothing constrains growthparentIFrameresizing whenfill_heightis true, sincefill_heightsemantics mean "fill available space" not "grow the container to fit content"Test plan
fill_height=True(default forChatInterface) andfooter_links=[]— verify it no longer grows infinitelyfill_height=Trueand defaultfooter_links— verify normal behavior is preservedfill_height=Falseandfooter_links=[]— verify iframe resizing still works🤖 Generated with Claude Code