From 7a96893093240d80eb7a8ee4ef571ae2ce0d1f36 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 2 May 2024 03:11:56 -0700 Subject: [PATCH] refac: mobile device detection --- src/lib/components/chat/MessageInput.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 50adc7c8c..e52090a73 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -762,7 +762,13 @@ : $i18n.t('Send a Message')} bind:value={prompt} on:keypress={(e) => { - if (window.innerWidth > 1024) { + if ( + !( + 'ontouchstart' in window || + navigator.maxTouchPoints > 0 || + navigator.msMaxTouchPoints > 0 + ) + ) { if (e.keyCode == 13 && !e.shiftKey) { e.preventDefault(); }