From c12f9c9639e64213cf0aa46215f48232b72f757c Mon Sep 17 00:00:00 2001 From: ilhooq Date: Tue, 10 Sep 2024 09:22:54 +0200 Subject: [PATCH] Permet l'ajout de nouvelles lignes dans le message --- vite/src/ChatApp.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vite/src/ChatApp.svelte b/vite/src/ChatApp.svelte index 345a57e..6490cc2 100644 --- a/vite/src/ChatApp.svelte +++ b/vite/src/ChatApp.svelte @@ -169,6 +169,12 @@ } function handleChatInputKey(event) { + + if (event.key === 'Enter' && event.shiftKey) { + // Allow the default behavior of adding a new line + return; + } + if (event.key === 'Enter') { sendMessage(chatInput.value); }