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

Copy event does not work for gr.Chatbot #10321

Open
1 task done
tankgit opened this issue Jan 9, 2025 · 2 comments
Open
1 task done

Copy event does not work for gr.Chatbot #10321

tankgit opened this issue Jan 9, 2025 · 2 comments
Labels
bug Something isn't working needs repro Awaiting full reproduction

Comments

@tankgit
Copy link

tankgit commented Jan 9, 2025

Describe the bug

Copy event does not work for gr.Chatbot.
It does copy the message, but the customized copy event does not run.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

examples = [
    {"role": "user", "content": "User message"},
    {
        "role": "assistant",
        "content": "This is a plain text",
    },
]


def copy_event():
    gr.Info("copied!")


with gr.Blocks() as demo:
    chatbot = gr.Chatbot(
        type="messages",
        show_copy_button=True,
    )

    demo.load(lambda: examples, None, chatbot)
    chatbot.copy(copy_event, None, None)

demo.launch()

Screenshot

No response

Logs

No response

System Info

Gradio==5.10.0
Python==3.10.14

Severity

I can work around it

@tankgit tankgit added the bug Something isn't working label Jan 9, 2025
@abidlabs
Copy link
Member

abidlabs commented Jan 9, 2025

It works for me @tankgit, although I notice a separate issue around z-index:

image

@abidlabs abidlabs added the needs repro Awaiting full reproduction label Jan 9, 2025
@abidlabs
Copy link
Member

abidlabs commented Jan 9, 2025

Can you try on a reproducible environment like a Google Colab? If it doesn't work for you, please share a link to the Colab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs repro Awaiting full reproduction
Projects
None yet
Development

No branches or pull requests

2 participants