ソースを参照

refac: mobile device detection

Timothy J. Baek 1 年間 前
コミット
7a96893093
1 ファイル変更7 行追加1 行削除
  1. 7 1
      src/lib/components/chat/MessageInput.svelte

+ 7 - 1
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();
 										}