Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent broken scroll_to_output in Spaces #4822

Merged
merged 4 commits into from Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -38,6 +38,7 @@
- Don't crash when uploaded image has broken EXIF data, by [@akx](https://github.com/akx) in [PR 4764](https://github.com/gradio-app/gradio/pull/4764)
- Place toast messages at the top of the screen by [@pngwn](https://github.com/pngwn) in [PR 4796](https://github.com/gradio-app/gradio/pull/4796)
- Fix regressed styling of Login page when auth is enabled by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4797](https://github.com/gradio-app/gradio/pull/4797)
- Prevent broken scrolling to output on Spaces by [@aliabid94](https://github.com/aliabid94) in [PR 4822](https://github.com/gradio-app/gradio/pull/4822)

## Other Changes:

Expand Down
2 changes: 1 addition & 1 deletion gradio/blocks.py
Expand Up @@ -283,7 +283,7 @@ def set_event_trigger(
"js": js,
"queue": False if fn is None else queue,
"api_name": api_name,
"scroll_to_output": scroll_to_output,
"scroll_to_output": False if utils.get_space() else scroll_to_output,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't change it here -- otherwise even if a developer explicitly sets scroll_to_output=True in the event, it won't take effect in Spaces. I would change the the default value in set_event_trigger()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disagree, it will break the app on Spaces, so even if it's explicitly allowed we stop it on Spaces. If a user sets it locally and then uploads it to spaces, it shouldn't break the app on spaces.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"show_progress": show_progress,
"every": every,
"batch": batch,
Expand Down