From 1bd14cdf94acdd6b6743772205577532bfefebd6 Mon Sep 17 00:00:00 2001 From: Meleki Date: Sat, 28 Feb 2026 00:18:42 +0100 Subject: [PATCH] =?UTF-8?q?Enter=20sendet,=20Shift+Enter=20f=C3=BCr=20Zeil?= =?UTF-8?q?enumbruch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/css/base.css | 4 ++-- wwwroot/js/pages/chat-page.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wwwroot/css/base.css b/wwwroot/css/base.css index e0ec0fd..fbb25f2 100644 --- a/wwwroot/css/base.css +++ b/wwwroot/css/base.css @@ -18,7 +18,7 @@ body { flex-direction: column; } -body, button, input, select, textarea { +body, button, input, select, textarea, #input { font-family: var(--font); color: var(--text); } @@ -27,7 +27,7 @@ body { font-size: var(--font-size); } -button, input, select, textarea, h1, h2, h3, h4, h5 { +button, input, select, textarea, #input, h1, h2, h3, h4, h5 { font-size: 1em; } diff --git a/wwwroot/js/pages/chat-page.js b/wwwroot/js/pages/chat-page.js index cfd40ed..b826bd5 100644 --- a/wwwroot/js/pages/chat-page.js +++ b/wwwroot/js/pages/chat-page.js @@ -60,11 +60,13 @@ registerPage('chat', { const sendBtn = document.getElementById('send'); if (sendBtn) sendBtn.addEventListener('click', sendMessage); - // Ctrl+Enter const inputEl = document.getElementById('input'); if (inputEl) { inputEl.addEventListener('keydown', (e) => { - if (e.ctrlKey && e.key === 'Enter') sendMessage(); + if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) { + e.preventDefault(); + sendMessage(); + } }); inputEl.addEventListener('input', function () { this.style.height = 'auto';