Spaces:
Sleeping
Sleeping
Taylor commited on
Commit ·
a06fe42
1
Parent(s): bad02a2
fix: make prompt input interactive in Gradio 5
Browse filesGradio 5 restructured label wrapping -- hiding the label element
was blocking the textarea. Target just the label text span instead.
Also explicitly set interactive=True.
app.py
CHANGED
|
@@ -77,7 +77,7 @@ CSS = """
|
|
| 77 |
/* Input */
|
| 78 |
#prompt-input textarea { background: #111114 !important; border: 1px solid #1f1f23 !important; border-radius: 8px !important; color: #fafafa !important; font-size: 1rem !important; padding: 1rem !important; }
|
| 79 |
#prompt-input textarea:focus { border-color: #3b82f6 !important; box-shadow: 0 0 0 2px rgba(59,130,246,0.1) !important; }
|
| 80 |
-
#prompt-input label { display: none !important; }
|
| 81 |
|
| 82 |
/* Generate button */
|
| 83 |
#gen-btn { background: #3b82f6 !important; border: none !important; border-radius: 8px !important; font-weight: 500 !important; font-size: 0.9rem !important; padding: 0.75rem 2rem !important; transition: all 150ms !important; }
|
|
@@ -112,7 +112,7 @@ with gr.Blocks(css=CSS, theme=gr.themes.Base(primary_hue="blue", neutral_hue="zi
|
|
| 112 |
""")
|
| 113 |
|
| 114 |
# Input
|
| 115 |
-
prompt = gr.Textbox(elem_id="prompt-input", placeholder="What would you like to ask?", lines=2, show_label=False)
|
| 116 |
btn = gr.Button("Generate", elem_id="gen-btn", variant="primary")
|
| 117 |
|
| 118 |
# Outputs
|
|
|
|
| 77 |
/* Input */
|
| 78 |
#prompt-input textarea { background: #111114 !important; border: 1px solid #1f1f23 !important; border-radius: 8px !important; color: #fafafa !important; font-size: 1rem !important; padding: 1rem !important; }
|
| 79 |
#prompt-input textarea:focus { border-color: #3b82f6 !important; box-shadow: 0 0 0 2px rgba(59,130,246,0.1) !important; }
|
| 80 |
+
#prompt-input > label > span { display: none !important; }
|
| 81 |
|
| 82 |
/* Generate button */
|
| 83 |
#gen-btn { background: #3b82f6 !important; border: none !important; border-radius: 8px !important; font-weight: 500 !important; font-size: 0.9rem !important; padding: 0.75rem 2rem !important; transition: all 150ms !important; }
|
|
|
|
| 112 |
""")
|
| 113 |
|
| 114 |
# Input
|
| 115 |
+
prompt = gr.Textbox(elem_id="prompt-input", placeholder="What would you like to ask?", lines=2, label="Prompt", show_label=False, interactive=True)
|
| 116 |
btn = gr.Button("Generate", elem_id="gen-btn", variant="primary")
|
| 117 |
|
| 118 |
# Outputs
|