gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
32.21k stars 2.41k forks source link

Scrollbar in gradio chatbot not automatically moving to the bottom after update #9134

Open alvelvis opened 1 month ago

alvelvis commented 1 month ago

Describe the bug

I was using version 4.37.1, where the chatbot scrollbar would automatically go to the bottom whenever there's new interaction.

But then I looked for the bugfix you did here #8865, so I updated to 4.39.0, and now the scroll bar won't move to the bottom of the chatbot automatically anymore. I tried the latest release as well. Code for reproduction below.

Have you searched existing issues? 🔎

Reproduction

import gradio as gr
with gr.Blocks() as demo:
    chatbot = gr.Chatbot(
                    value=[[None, f"Olá"]],
                    show_label=False,
                    avatar_images=[None, "https://st5.depositphotos.com/72897924/62255/v/450/depositphotos_622556394-stock-illustration-robot-web-icon-vector-illustration.jpg"],
                    likeable=True,
                    )

    chatbot.like(lambda x: x, inputs=[chatbot], outputs=None)
    query_input = gr.Textbox(label="Pergunta", placeholder="Digite aqui sua pergunta e então pressione Enter", elem_id="query_input")

    on_submit = lambda y, x: x + [["Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."]]

    submit = {'fn': on_submit, 'inputs':[query_input, chatbot], 'outputs':[chatbot]}
    query_input.submit(**submit)

    gr.Examples(examples=[
        ["a"],
        ["b"],
        ["c"],
        ["d"]], 
    **submit, run_on_click=True, label="Exemplos")

    submit_btn = gr.Button('Try')
    submit_btn.click(**submit)

demo.launch()

Screenshot

No response

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.39.0
gradio_client version: 1.1.1

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
anyio: 4.4.0
fastapi: 0.111.0
ffmpy: 0.3.2
gradio-client==1.1.1 is not installed.
httpx: 0.27.0
huggingface-hub: 0.23.4
importlib-resources: 6.4.0
jinja2: 3.1.4
markupsafe: 2.1.5
matplotlib: 3.9.1
numpy: 1.26.4
orjson: 3.10.6
packaging: 24.1
pandas: 2.2.2
pillow: 10.4.0
pydantic: 2.8.2
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.5.1
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.12.2
urllib3: 2.2.2
uvicorn: 0.30.1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2024.6.1
httpx: 0.27.0
huggingface-hub: 0.23.4
packaging: 24.1
typing-extensions: 4.12.2
websockets: 11.0.3

Severity

Blocking usage of gradio

abidlabs commented 1 month ago

cc @dawoodkhan82

savvaki commented 3 weeks ago

I can confirm this is an issue

letmaik commented 5 days ago

Confirmed as well. Worked in 4.37.1 and broke with 4.37.2.

jiangweihao02 commented 1 day ago

Confirmed as well.Scroll bar only move to the bottom the first time you update.(version 4.44.0)