-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Scrolling large Dataframe increases visible row size #9288
Comments
I just had the same problem here! |
Which browser are y'all using? |
@abidlabs I tested this issue reproduced in all of these thee environments. It seems not browser-specific issue.
|
You're right, I can reproduce this, thanks @bilzard, we'll take a look at this! |
This is definitely bad and wrong. Will fix when I tackle the data frame shortly. |
I'm also having this issue after upgrading from It seems to be this line that was added in the SSR update which causes this behaviour, commenting it out fixes it. A temporary fix is setting qa_pairs = gr.Dataframe(data, elem_classes="qa-pairs") .qa-pairs .table-wrap {
min-height: 170px;
max-height: 170px;
} |
Thanks @cornzz for isolating the issue. We'll fix this as soon as we can (if you'd like, you can open a PR) |
the bug haven't been fixed yet. |
Another manifestation of this bug is happening on this Space: https://huggingface.co/spaces/lhoestq/Common-Crawl-Pipeline-Creator |
^ for the common crawl space I used @cornzz workaround for now |
For me, the workaround doesn't work. It fixes a viewport for the table, but the table grows inside the viewport and we cannot see the end of the table. (radio 5.3.0 |
@abidlabs it seems to me another symptom of this bug (I happened to come across this as I'm working with Dataframe components today) is that the header row also changes size when scrolling, which doesn't seem to be something that should be intended. I came across the bug on this issue, and by using the workaround described:
I was able to work fine. But the first row's height is also being increased and I'm not sure if this is FAD. Repro code: import gradio as gr
with gr.Blocks(
css="#test_dataframe {min-height: 400px; max-height: 400px;}" # this is the workaround, working
) as demo:
gr.Markdown("## Testing Dataframe ##")
# Example dataset with 200 rows and 5 columns, each cell containing more than 200 characters
example_data = [
[
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. " * 4,
"Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " * 4,
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris " * 4,
"Nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in " * 4,
"Reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. " * 4
]
for _ in range(200)
]
documents_list = gr.DataFrame(
value=example_data,
headers=["Column 1", "Column 2", "Column 3", "Column 4", "Column 5"],
elem_id="test_dataframe"
#wrap=True, # this just makes it 10x worse
)
gr.Button("Mock Button to a component after DataFrame")
demo.launch(debug=True) this results in this test case: In my real dataset it's much worse and more noticeable, because I also use wrap = True here: |
I've encountered a similar problem to what's described in #9288, but with an additional behavior: when the horizontal scrollbar is positioned at the far right and I scroll upward, the dataframe shrinks vertically, eventually flattening completely. This was observed while developing on Linux Mint 22.04 with the latest version of Chrome at this time, using both |
Describe the bug
In my environment, scrolling long dataframe increasing visible row size.
I think it should be static size even scrolling.
Have you searched existing issues? 🔎
Reproduction
Screenshot
output.mp4
Logs
No js/python error printed (since its UI's malfunctioning)
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: