Skip to content

fix: prevent infinite vertical growth when footer_links=[]#13006

Closed
giulio-leone wants to merge 2 commits intogradio-app:mainfrom
giulio-leone:fix/fill-height-no-footer-infinite-growth
Closed

fix: prevent infinite vertical growth when footer_links=[]#13006
giulio-leone wants to merge 2 commits intogradio-app:mainfrom
giulio-leone:fix/fill-height-no-footer-infinite-growth

Conversation

@giulio-leone
Copy link
Copy Markdown
Contributor

Description

Fixes the infinite vertical growth bug when launching with footer_links=[].

Problem

When footer_links=[], the footer element is not rendered. The .wrap container uses min-height: 100% (in app_mode) with no upper bound. Combined with:

  • main.contain's flex-grow: 1
  • The root column's scale: 1 (from fill_height)

This creates a feedback loop: container grows → column grows → container grows → infinite.

The footer normally acts as a natural bottom anchor that prevents this. Without it, nothing constrains the flex expansion.

Solution

When in app_mode with no footer (footer_links.length === 0):

  • Add max-height: 100vh to cap the container at the viewport height
  • Add overflow: auto to enable scrolling if content exceeds the viewport

This only applies when the footer is absent — normal behavior is unchanged.

Reproduction

import gradio as gr

def chatbot_response(message, history):
    return f"Hello, you said: {message}"

demo = gr.ChatInterface(chatbot_response, title="Infinite space")
demo.launch(footer_links=[])

Live demo: https://huggingface.co/spaces/Carbaz/infinite_space

Closes #12992

When `footer_links=[]`, the footer element is not rendered but the
`.wrap` container uses `min-height: 100%` with no upper bound.
Combined with `main.contain`'s `flex-grow: 1` and fill_height's
`scale: 1` on the root column, this creates a feedback loop where
the container keeps growing beyond the viewport.

Fix: when in app_mode with no footer, cap the container at `100vh`
and enable overflow scrolling so content doesn't push the container
beyond the viewport.

Fixes #12992

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gradio-pr-bot
Copy link
Copy Markdown
Collaborator

gradio-pr-bot commented Mar 13, 2026

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/4f4cc6a54017228fd7a8bea02643c659df1d5113/gradio-6.9.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@4f4cc6a54017228fd7a8bea02643c659df1d5113#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/4f4cc6a54017228fd7a8bea02643c659df1d5113/gradio-client-2.1.0.tgz

@gradio-pr-bot
Copy link
Copy Markdown
Collaborator

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/core patch
gradio patch

  • fix: prevent infinite vertical growth when footer_links=[]

‼️ Changeset not approved. Ensure the version bump is appropriate for all packages before approving.

  • Maintainers can approve the changeset by checking this checkbox.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@freddyaboulton
Copy link
Copy Markdown
Collaborator

freddyaboulton commented Mar 13, 2026

Hi @giulio-leone ! This does not fix the issue: https://huggingface.co/spaces/freddyaboulton/infinite_space . I installed the wheel from this pr in a space and I see the same problem.

I will close this because we've seen a lot of ai-generated prs that are not properly tested. We would more than happy to review this once you can demonstrate it fixes the issue!

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.

3 participants