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

scroll to top when api clicked in spaces #4714

Merged
merged 5 commits into from Jun 29, 2023
Merged

scroll to top when api clicked in spaces #4714

merged 5 commits into from Jun 29, 2023

Conversation

pngwn
Copy link
Member

@pngwn pngwn commented Jun 28, 2023

Closes #4682.

Click view api on a space and it should scroll to the top.

@gradio-pr-bot
Copy link
Contributor

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-4714-all-demos

@pngwn
Copy link
Member Author

pngwn commented Jun 28, 2023

the PR preview is a bit messed up because there are so many endpoints on the page but it seem to work.

@pngwn
Copy link
Member Author

pngwn commented Jun 28, 2023

This is very similar to the error modal fix in that it is spaces only and cannot currently be tested.

@abidlabs
Copy link
Member

Nice! Taking a look now

@abidlabs abidlabs self-requested a review June 29, 2023 15:26
@hannahblair
Copy link
Collaborator

hannahblair commented Jun 29, 2023

Tested and looks like the fix works! Is there a way we can get scroll-behavior: smooth work here? Not a blocker, but it would make for nicer UX. I've never tested whether that works in an iframe.

Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

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

Confirmed the fix locally in a jupyter iframe, locally in a new tab, and on Spaces.

@pngwn
Copy link
Member Author

pngwn commented Jun 29, 2023

@hannahblair

Tested and looks like the fix works! Is there a way we can get scroll-behavior: smooth work here? Not a blocker, but it would make for nicer UX. I've never tested whether that works in an iframe.

I'm not actually sure, this API is provided by the iFrameResizer library that we use and the documentation is a little thin. I'll see if I can get the behaviour argument working.

@pngwn
Copy link
Member Author

pngwn commented Jun 29, 2023

I checked and we can't do this from our side just yet but we can do it if we make a tweak on spaces. I'll figure out how to setup moonlanding and see if they'd be open to a PR.

@pngwn pngwn merged commit b6f02bd into main Jun 29, 2023
8 checks passed
@pngwn pngwn deleted the 4682-scroll-api branch June 29, 2023 19:59
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.

UI: scroll to top when clicking on "Use via API"
4 participants