mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-11 11:19:58 +08:00
* dropdown choice bug * add changeset * add changeset * changes * add changeset * format * key down: * change * change * format * add KeyDownData * changes * add demo * notebook * add changeset * key up * notebook * changes * Delete .changeset/shaggy-hairs-peel.md * Delete .changeset/tasty-spies-spend.md * revert changeset deletion * change * fix unit test * type disable * fix * cset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
16 lines
373 B
Python
16 lines
373 B
Python
import gradio as gr
|
|
|
|
def test(value, key_up_data: gr.KeyUpData):
|
|
return {
|
|
"component value": value,
|
|
"input value": key_up_data.input_value,
|
|
"key": key_up_data.key
|
|
}
|
|
|
|
with gr.Blocks() as demo:
|
|
d = gr.Dropdown(["abc", "def"], allow_custom_value=True)
|
|
t = gr.JSON()
|
|
d.key_up(test, d, t)
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch() |