Spaces:
Runtime error
Runtime error
Jithin James
commited on
Commit
·
c512664
1
Parent(s):
61bed76
added tests folder
Browse files- test/dropdown.py +15 -0
test/dropdown.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
|
4 |
+
def debug_click(drop_down):
|
5 |
+
print(drop_down)
|
6 |
+
return "yes"
|
7 |
+
|
8 |
+
|
9 |
+
with gr.Blocks() as demo:
|
10 |
+
drop_down = gr.Dropdown(
|
11 |
+
choices=["first", "second"], type="index", interactive=True, multiselect=False
|
12 |
+
)
|
13 |
+
txt = gr.Textbox()
|
14 |
+
btn = gr.Button("Clear")
|
15 |
+
btn.click(debug_click, inputs=drop_down, outputs=txt)
|