Make buttons in gr.ChatInterface more mobile-friendly (#7869)

* make buttons in chat interface more mobile friendly

* add changeset

* add changeset

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Abubakar Abid 2024-03-27 23:41:03 -07:00 committed by GitHub
parent d95a1a44d6
commit b9dbcf7aa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
feat:Make buttons in `gr.ChatInterface` more mobile-friendly

View File

@ -193,7 +193,9 @@ class ChatInterface(Blocks):
if isinstance(btn, Button):
btn.render()
elif isinstance(btn, str):
btn = Button(btn, variant="secondary", size="sm")
btn = Button(
btn, variant="secondary", size="sm", min_width=60
)
else:
raise ValueError(
f"All the _btn parameters must be a gr.Button, string, or None, not {type(btn)}"