Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions gradio/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/textbox/shared/Textbox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
}

async function handle_keypress(e: KeyboardEvent): Promise<void> {
if (e.key === "Enter" && e.shiftKey && lines > 1) {
if (e.key === "Enter" && !e.shiftKey) {
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
e.preventDefault();
await tick();
onsubmit?.();
Expand Down
14 changes: 14 additions & 0 deletions test_textbox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import gradio as gr

def echo(text_value):
print("CALLED:", repr(text_value))
return text_value

with gr.Blocks() as demo:
one_line = gr.Textbox(label="Single Line")
multi_line = gr.Textbox(lines=2, label="Multi Line")

one_line.submit(fn=echo, inputs=one_line, outputs=one_line)
multi_line.submit(fn=echo, inputs=multi_line, outputs=multi_line)

demo.launch()
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
Loading