Skip to content

Commit

Permalink
scroll to top when api clicked in spaces (#4714)
Browse files Browse the repository at this point in the history
* scroll to top when api clicked in spaces

* changelog

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
  • Loading branch information
pngwn and abidlabs committed Jun 29, 2023
1 parent 409593e commit b6f02bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -30,6 +30,7 @@
- When an error modal is shown in spaces, ensure we scroll to the top so it can be seen by [@pngwn](https://github.com/pngwn) in [PR 4712](https://github.com/gradio-app/gradio/pull/4712)
- Update depedencies by [@pngwn](https://github.com/pngwn) in [PR 4675](https://github.com/gradio-app/gradio/pull/4675)
- Fixes `gr.Dropdown` being cutoff at the bottom by [@abidlabs](https://github.com/abidlabs) in [PR 4691](https://github.com/gradio-app/gradio/pull/4691).
- Scroll top when clicking "View API" in spaces by [@pngwn](https://github.com/pngwn) in [PR 4714](https://github.com/gradio-app/gradio/pull/4714)
- Fix bug where `show_label` was hiding the entire component for `gr.Label` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 4713](https://github.com/gradio-app/gradio/pull/4713)

## Other Changes:
Expand Down
3 changes: 3 additions & 0 deletions js/app/src/api_docs/ApiDocs.svelte
Expand Up @@ -132,6 +132,9 @@
onMount(() => {
document.body.style.overflow = "hidden";
if ("parentIFrame" in window) {
window.parentIFrame?.scrollTo(0, 0);
}
return () => {
document.body.style.overflow = "auto";
};
Expand Down

0 comments on commit b6f02bd

Please sign in to comment.