Closed jjshoots closed 9 months ago
Hi @jjshoots thanks for creating the issue. The code to update the choices here is actually incorrect. You should return gr.Dropdown(choices=...)
from your function if you want to update the choices. Here's the working version of the code:
import gradio as gr
choices = [(c, i) for i, c in enumerate("abcdefghijklmnopqrstuvwxyz")]
with gr.Blocks() as app:
dropdown1 = gr.Dropdown(choices=[("null", 1337)], interactive=True, allow_custom_value=True)
button1 = gr.Button(value="Click me to enable options")
button1.click(fn=lambda: gr.Dropdown(choices=choices), outputs=[dropdown1])
app.launch()
Describe the bug
The dropdown option freezes the interface when
allow_custom_value=True
andinteractive=True
and choices are updated by another component.Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
I can work around it