Skip to content

Commit

Permalink
ensure dataframe doesn't scroll unless needed (#5445)
Browse files Browse the repository at this point in the history
* ensure dataframe doesn't scroll unless needed

* add changeset

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
pngwn and gradio-pr-bot committed Sep 7, 2023
1 parent 710cbb6 commit 67bb7bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/chatty-socks-bow.md
@@ -0,0 +1,6 @@
---
"@gradio/dataframe": patch
"gradio": patch
---

fix:ensure dataframe doesn't scroll unless needed
7 changes: 5 additions & 2 deletions js/dataframe/shared/VirtualTable.svelte
Expand Up @@ -103,11 +103,14 @@
return "forwards";
}
const { top: viewport_top } = viewport.getBoundingClientRect();
const { top, bottom } = current.getBoundingClientRect();
if (top < 37) {
if (top - viewport_top < 37) {
return "back";
}
if (bottom > viewport_height) {
if (bottom - viewport_top > viewport_height) {
return "forwards";
}
Expand Down

0 comments on commit 67bb7bc

Please sign in to comment.