Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom value in gr.Dropdown is not reflected without pressing enter #5515

Closed
1 task done
hysts opened this issue Sep 13, 2023 · 0 comments · Fixed by #5525
Closed
1 task done

Custom value in gr.Dropdown is not reflected without pressing enter #5515

hysts opened this issue Sep 13, 2023 · 0 comments · Fixed by #5525
Assignees
Labels
bug Something isn't working

Comments

@hysts
Copy link
Collaborator

hysts commented Sep 13, 2023

Describe the bug

Not sure if this is a bug, but it would be nice if it was reflected without pressing the enter key.
It's kind of unexpected behavior that if you didn't press enter, the dropdown menu shows the text you typed but it's actually not used.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

https://huggingface.co/spaces/hysts-debug/dropdown-custom-value

import gradio as gr

with gr.Blocks() as demo:
    with gr.Row():
        with gr.Column():
            dropdown = gr.Dropdown(
                choices=["abc", "def", "ghi"],
                value="abc",
                allow_custom_value=True,
            )
            button = gr.Button()
        with gr.Column():
            out = gr.Textbox()

    button.click(fn=lambda x: x, inputs=dropdown, outputs=out)

if __name__ == "__main__":
    demo.queue().launch()

Screenshot

0.mp4

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 3.44.0
gradio_client version: 0.5.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.1.1
fastapi: 0.103.1
ffmpy: 0.3.1
gradio-client==0.5.0 is not installed.
httpx: 0.25.0
huggingface-hub: 0.16.4
importlib-resources: 6.0.1
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.7.3
numpy: 1.25.2
orjson: 3.9.7
packaging: 23.1
pandas: 2.0.3
pillow: 10.0.0
pydantic: 1.10.12
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
requests: 2.31.0
semantic-version: 2.10.0
typing-extensions: 4.7.1
uvicorn: 0.23.2
websockets: 11.0.3
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2023.6.0
httpx: 0.25.0
huggingface-hub: 0.16.4
packaging: 23.1
requests: 2.31.0
typing-extensions: 4.7.1
websockets: 11.0.3

Severity

I can work around it

@hysts hysts added the bug Something isn't working label Sep 13, 2023
@abidlabs abidlabs added this to the Component Cleanup milestone Sep 13, 2023
@hannahblair hannahblair self-assigned this Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants