From db01b7043b94d07e7e9a5131c235f0580ab967f0 Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Sun, 3 Nov 2024 10:02:44 -0500
Subject: Bare-bones multiline input

---
 ui/lib/components/MessageInput.svelte | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'ui/lib/components/MessageInput.svelte')

diff --git a/ui/lib/components/MessageInput.svelte b/ui/lib/components/MessageInput.svelte
index 7aac442..94ef98a 100644
--- a/ui/lib/components/MessageInput.svelte
+++ b/ui/lib/components/MessageInput.svelte
@@ -20,13 +20,21 @@
 			input.focus();
 		}
 	}
+
+	function onKeyDown(event) {
+		if (!event.altKey && event.key === 'Enter') {
+			handleSubmit();
+			event.preventDefault();
+		}
+	}
 </script>
 
 <form on:submit|preventDefault={handleSubmit} class="flex flex-row flex-nowrap">
-	<input
+	<textarea
 		bind:this={input}
 		bind:value
 		{disabled}
+		on:keydown={onKeyDown}
 		type="search"
 		class="flex-auto h-6 input rounded-r-none"
 	/>
-- 
cgit v1.2.3

