about summary refs log tree commit diff
path: root/src/components/ProfileHoverCard
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/components/ProfileHoverCard
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/components/ProfileHoverCard')
-rw-r--r--src/components/ProfileHoverCard/index.web.tsx3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/components/ProfileHoverCard/index.web.tsx b/src/components/ProfileHoverCard/index.web.tsx
index 75eba6598..024867b1a 100644
--- a/src/components/ProfileHoverCard/index.web.tsx
+++ b/src/components/ProfileHoverCard/index.web.tsx
@@ -11,6 +11,7 @@ import {sanitizeHandle} from '#/lib/strings/handles'
 import {useModerationOpts} from '#/state/preferences/moderation-opts'
 import {usePrefetchProfileQuery, useProfileQuery} from '#/state/queries/profile'
 import {useSession} from '#/state/session'
+import {isTouchDevice} from 'lib/browser'
 import {useProfileShadow} from 'state/cache/profile-shadow'
 import {formatCount} from '#/view/com/util/numeric/format'
 import {UserAvatar} from '#/view/com/util/UserAvatar'
@@ -43,8 +44,6 @@ const floatingMiddlewares = [
   }),
 ]
 
-const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 1
-
 export function ProfileHoverCard(props: ProfileHoverCardProps) {
   if (props.disable || isTouchDevice) {
     return props.children