gradio icon indicating copy to clipboard operation
gradio copied to clipboard

gr.Dropdown not properly selecting clicked item.

Open Solomin0 opened this issue 10 months ago • 1 comments

Describe the bug

When there are multiple items with the same name in the Dropdown list, clicking one only selects the first occurrence in the list.

I thought an expected behavior would be either selecting all items with the same name or selecting the index of the clicked one.

Also if you keep clicking the values not in position 0 they will be continuously added into the selection. This might be a different issue though. If yall need a video of this instead of screenshots let me know. Thanks.

Have you searched existing issues? 🔎

  • [X] I have searched and found no existing issues

Reproduction

import gradio as gr

with gr.Blocks() as demo:
    a = gr.Dropdown(choices=["a", "a","a"], interactive = True, multiselect=True)
    
demo.launch()

Screenshot

Clicking index 0 correctly selected index 0 image

Clicking index 1 incorrectly selected index 0 image

Clicking index 1 seven times incorrectly added it seven times to the selection. image

Logs

No response

System Info

Operating System: Windows
gradio version: 4.20.1
gradio_client version: 0.11.0

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

aiofiles: 23.2.1
altair: 5.2.0
fastapi: 0.109.2
ffmpy: 0.3.2
gradio-client==0.11.0 is not installed.
httpx: 0.25.2
huggingface-hub: 0.20.3
importlib-resources: 6.1.1
jinja2: 3.1.3
markupsafe: 2.1.5
matplotlib: 3.8.3
numpy: 1.26.4
orjson: 3.9.14
packaging: 23.2
pandas: 2.2.0
pillow: 10.2.0
pydantic: 2.6.1
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.3.0
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.9.0
typing-extensions: 4.9.0
uvicorn: 0.27.1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.2.0
httpx: 0.25.2
huggingface-hub: 0.20.3
packaging: 23.2
typing-extensions: 4.9.0
websockets: 11.0.3

Severity

I can work around it

Solomin0 avatar Mar 27 '24 19:03 Solomin0