Fix fill_height infinite growth with empty footer_links in iframes#4
Open
Fix fill_height infinite growth with empty footer_links in iframes#4
Conversation
…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>
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=Trueandfooter_links=[], the interface grows infinitely on Hugging Face Spaceshandle_resize()inBlocks.svelteusesparentIFrame.size()(iframe-resizer) to set the iframe height based on content height. Whenfill_height=True, the content usesflex-grow: 1to fill available space. This creates a feedback loop: content fills iframe -> iframe-resizer reads content height and grows iframe -> content fills new height -> repeat foreverparentIFrame.size()call whenfill_heightis enabled, since the app is designed to fill available space rather than dictate the iframe sizeTest plan
fill_height=Trueandfooter_links=[], deploy to HF Spaces, verify it no longer grows infinitelyfill_height=Falsestill resize correctly in iframesfill_height=Trueand non-emptyfooter_linksstill work correctly