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

Dropdown issues #3549

Merged
merged 10 commits into from
Mar 21, 2023
Merged

Dropdown issues #3549

merged 10 commits into from
Mar 21, 2023

Conversation

aliabid94
Copy link
Collaborator

@aliabid94 aliabid94 commented Mar 20, 2023

This PR fixes a lot of the dropdown issues raised by @space-nuko. GIF below shows new behavior of dropdown:

Recording 2023-03-20 at 13 05 07

code for demo at bottom.

Changes in this PR:

import gradio as gr

with gr.Blocks() as demo:
    gr.Markdown(
    """
    # Hello World!
    Start typing below to see the output.
    """)
    gr.Dropdown(list("abcd"))
    gr.Dropdown(list("abcdefghijklmnopqrstuvwxyz"))
    gr.Dropdown(list("abcdefghijklmnopqrstuvwxyz"), multiselect=True)
    gr.Dropdown(list("abcd"))
    gr.HTML("""
    <div style="height: 600px; width: 240px; background-color: blue"></div>
    """)

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

@aliabid94 aliabid94 requested review from abidlabs and pngwn March 20, 2023 20:15
@gradio-pr-bot
Copy link
Collaborator

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-3549-all-demos

@aliabid94 aliabid94 marked this pull request as ready for review March 20, 2023 20:45
@abidlabs abidlabs requested a review from dawoodkhan82 March 20, 2023 21:43
@abidlabs
Copy link
Member

Tested and works well @aliabid94. Nice PR!

@space-nuko
Copy link
Contributor

LGTM 👍

@space-nuko
Copy link
Contributor

Actually there's one issue I found, it has to do with the multiselect dropdown

Every other time you click on a choice it closes the list, even though you could still select/unselect other options

output.webm

@gradio-pr-bot
Copy link
Collaborator

The demo notebooks don't match the run.py files. Please run this command from the root of the repo and then commit the changes:

pip install nbformat && cd demo && python generate_notebooks.py

@aliabid94
Copy link
Collaborator Author

Fixed the issue space nuko pointed out. Also moved the dropdown so it does not cover the input text. Also now you can type to search when multiselect=False, fixes #3538

@abidlabs
Copy link
Member

Nice fixes @aliabid94! Thanks for raising these great issues @space-nuko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants