fix: skip iframe resize when fill_height is true#13014
Closed
wavebyrd wants to merge 1 commit intogradio-app:mainfrom
Closed
fix: skip iframe resize when fill_height is true#13014wavebyrd wants to merge 1 commit intogradio-app:mainfrom
wavebyrd wants to merge 1 commit intogradio-app:mainfrom
Conversation
…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
Collaborator
|
Duplicate of #13006 |
Author
|
Ping on this fill_height iframe fix. Ready for review! |
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_height=True(default forChatInterface) andfooter_links=[], the interface grows infinitely on HuggingFace SpacesResizeObserverfiresparentIFrame.size()based ongetBoundingClientRect(), 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.parentIFrameresizing whenfill_heightis true, sincefill_heightsemantics mean "fill available space" not "grow the container to fit content"Test plan
fill_height=Trueandfooter_links=[]-- should no longer grow infinitelyfill_height=Trueand defaultfooter_links-- normal behavior preservedfill_height=Falseandfooter_links=[]-- iframe resizing still works