mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
Some fixes to disabled buttons (#3288)
* Fixes to button disable * button * formatting * fixes * formatter
This commit is contained in:
parent
5df113a4d6
commit
06c4cd705f
@ -2,7 +2,7 @@
|
||||
|
||||
## New Features:
|
||||
- Updated image upload component to accept all image formats, including lossless formats like .webp by [@fienestar](https://github.com/fienestar) in [PR 3225](https://github.com/gradio-app/gradio/pull/3225)
|
||||
- Adds a disabled mode to the `gr.Button` component by setting `interactive=False` by [@abidlabs](https://github.com/abidlabs) in [PR 3266](https://github.com/gradio-app/gradio/pull/3266)
|
||||
- Adds a disabled mode to the `gr.Button` component by setting `interactive=False` by [@abidlabs](https://github.com/abidlabs) in [PR 3266](https://github.com/gradio-app/gradio/pull/3266) and [PR 3288](https://github.com/gradio-app/gradio/pull/3288)
|
||||
|
||||
|
||||
## Bug Fixes:
|
||||
|
@ -2945,13 +2945,13 @@ class Button(Clickable, IOComponent, SimpleSerializable):
|
||||
visible: bool | None = None,
|
||||
interactive: bool | None = None,
|
||||
):
|
||||
return {
|
||||
updated_config = {
|
||||
"variant": variant,
|
||||
"visible": visible,
|
||||
"value": value,
|
||||
"interactive": interactive,
|
||||
"__type__": "update",
|
||||
}
|
||||
return IOComponent.add_interactive_to_config(updated_config, interactive)
|
||||
|
||||
def style(self, *, full_width: bool | None = None, **kwargs):
|
||||
"""
|
||||
|
@ -886,8 +886,8 @@ def tex2svg(formula, *args):
|
||||
svg_start = xml_code.index("<svg ")
|
||||
svg_code = xml_code[svg_start:]
|
||||
svg_code = re.sub(r"<metadata>.*<\/metadata>", "", svg_code, flags=re.DOTALL)
|
||||
svg_code = re.sub(r' width="[^"]+"', '', svg_code)
|
||||
svg_code = re.sub(r' height="[^"]+"', '', svg_code)
|
||||
svg_code = re.sub(r' width="[^"]+"', "", svg_code)
|
||||
svg_code = re.sub(r' height="[^"]+"', "", svg_code)
|
||||
copy_code = f"<span style='font-size: 0px'>{formula}</span>"
|
||||
return f"{copy_code}{svg_code}"
|
||||
|
||||
|
@ -39,6 +39,8 @@
|
||||
}
|
||||
|
||||
button[disabled] {
|
||||
opacity: 0.5;
|
||||
filter: grayscale(30%);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user