import gradio as gr enable_copy_js = """ """ def on_copy(fn, inputs, outputs): copy_textbox = gr.Textbox(elem_id="copy_textbox", visible=False) return copy_textbox.change(fn, [copy_textbox] + inputs, outputs) # with gr.Blocks(head=enable_copy_js) as demo: # gr.Markdown("Hello\nTest Copy") # copy_textbox = gr.Textbox(elem_id="copy_textbox", visible=False) # def copy_handle(text): # gr.Info(text) # copy_textbox.change(copy_handle, copy_textbox) # demo.launch()