about summary refs log tree commit diff
path: root/src/lib/browser.ts
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-05-23 19:45:50 -0700
committerGitHub <noreply@github.com>2024-05-23 19:45:50 -0700
commit85782aeb930b63995d83157f581f66e564743626 (patch)
tree86a82c3fa0e163961cbc7002c63c2e6033111474 /src/lib/browser.ts
parentfa039e542d06c2e9e24f46464b18256aa0f10b7f (diff)
downloadvoidsky-85782aeb930b63995d83157f581f66e564743626.tar.zst
[🐴] Don't submit the message on return press when on a phone (web input) (#4203)
move this to the `onKeyDown` prop

Revert "do the same for tablets"

This reverts commit 47c709e2734f2acf34f89dd5aca42a75a2b56270.

do the same for tablets

don't submit message if the device is a phone on web

move `onTouchStart` to `browser.ts` globals
Diffstat (limited to 'src/lib/browser.ts')
-rw-r--r--src/lib/browser.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/browser.ts b/src/lib/browser.ts
index d5ecb4e85..d178a9a64 100644
--- a/src/lib/browser.ts
+++ b/src/lib/browser.ts
@@ -2,5 +2,6 @@
 export const isSafari = /^((?!chrome|android).)*safari/i.test(
   navigator.userAgent,
 )
-
 export const isFirefox = /firefox|fxios/i.test(navigator.userAgent)
+export const isTouchDevice =
+  'ontouchstart' in window || navigator.maxTouchPoints > 1