You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we know, it's possible to pass tuples (name, value) as choices in dropdown component.
If we select an option, then we open the dropdown list again, and click outside dropdown, it passes the name instead of value, then removes the selected option from display. Please see the video for complete details.
Expected behavior:
It should retain the previously selected value
Should pass value instead of name
Thanks.
Have you searched existing issues? 🔎
I have searched and found no existing issues
Reproduction
import gradio as gr
choices = [
("apple", 1),
("banana", 2),
("orange", 3),
("pear", 4),
("strawberry", 5)
]
with gr.Blocks() as demo:
drpDown = gr.Dropdown(choices=choices, label="Fruit", value=1, interactive=True)
@drpDown.input(inputs=[drpDown], outputs=None)
def handle_dropdown_change(value):
gr.Info(str(value))
demo.queue(default_concurrency_limit=13).launch(server_name='0.0.0.0', server_port=7860)
Screenshot
dropdown_issue.mp4
Logs
No response
System Info
gradio==4.7.1
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered:
Describe the bug
Hi,
As we know, it's possible to pass tuples (name, value) as choices in dropdown component.
If we select an option, then we open the dropdown list again, and click outside dropdown, it passes the
name
instead ofvalue
, then removes the selected option from display. Please see the video for complete details.Expected behavior:
value
instead ofname
Thanks.
Have you searched existing issues? 🔎
Reproduction
Screenshot
dropdown_issue.mp4
Logs
No response
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: