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

Add interactive=False mode to gr.Button #3266

Merged
merged 7 commits into from
Feb 21, 2023
Merged

Add interactive=False mode to gr.Button #3266

merged 7 commits into from
Feb 21, 2023

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Feb 21, 2023

Like other components, gr.Button should support a disabled mode if interactive=False is set. Note that unlike other components, gr.Button()'s interactive state should not be inferred based on whether it is an input component or not, so it needs to be explicitly set to interactive=False in order to be disabled.

The current way of designating the disabled state is to show a "can't-click" cursor and show no color change when a user hovers over the button. Open to feedback on this, though I wanted to keep it pretty simple so as to not need new css variables, etc.

Fixes: #3084

Recording 2023-02-21 at 10 56 39 (1)

@gradio-pr-bot
Copy link
Collaborator

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

Copy link
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@abidlabs
Copy link
Member Author

Thanks @pngwn for the review and suggesting the fix!

@abidlabs abidlabs merged commit 55162e5 into main Feb 21, 2023
@abidlabs abidlabs deleted the disabled-button branch February 21, 2023 19:11
dawoodkhan82 pushed a commit that referenced this pull request Feb 22, 2023
* add interactive=False to button

* add interactive=True by default

* changelog

* fix frontend

* fix backend test

* formatting

* review changes
dawoodkhan82 added a commit that referenced this pull request Feb 23, 2023
* dropdown

* more dropdown updates

* dropdown styling + option visibility

* changelog

* notebook

* fix test

* Allow more image formats (#3225)

* add wildcard to image input

* simplify mime types

* changelog

* regen noteboks

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: pngwn <hello@pngwn.io>

* fix webcam mirroring (#3245)

* fix webcam

* changelog

* fix changelog

* fix changelog

* fix changelog

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* Add `interactive=False` mode to `gr.Button` (#3266)

* add interactive=False to button

* add interactive=True by default

* changelog

* fix frontend

* fix backend test

* formatting

* review changes

* LaTeX height fix (#3258)

* latex height fix

* changelog

* formatting

* em

* em

* accidentally added script (#3273)

* Adding a script to benchmark the queue (#3272)

* added benchmark queue script

* changelg

* fix instructions

* Fix matplotlib image size (#3274)

* Fix matplotlib css

* CHANGELOG

* Undo lockfile

* Add timeouts to queue messages (#3196)

* Fix + test

* Remove print statements + fix import for 3.7

* CHANGELOG

* Remove more print statements

* Add 60 second timeout for uploading data

* Fix test

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* icons

* separate options into component

* formatting

* changelog

* changelog

* fix ui tests

* formatting again...

* backend test fix

* format

* doc fixes

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
Co-authored-by: fienestar <fienestar@gmail.com>
Co-authored-by: pngwn <hello@pngwn.io>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No interactive option for gr.Button()
3 participants