this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Test only use longpress for iOS

+22 -12
+22 -12
src/components/status.jsx
··· 789 789 x: 0, 790 790 y: 0, 791 791 }); 792 + const isIOS = 793 + window.ontouchstart !== undefined && 794 + /iPad|iPhone|iPod/.test(navigator.userAgent); 795 + // Only iOS/iPadOS browsers don't support contextmenu 796 + // Some comments report iPadOS might support contextmenu if a mouse is connected 792 797 const bindLongPressContext = useLongPress( 793 - (e) => { 794 - const { clientX, clientY } = e.touches?.[0] || e; 795 - // link detection copied from onContextMenu because here it works 796 - const link = e.target.closest('a'); 797 - if (link && /^https?:\/\//.test(link.getAttribute('href'))) return; 798 - e.preventDefault(); 799 - setContextMenuAnchorPoint({ 800 - x: clientX, 801 - y: clientY, 802 - }); 803 - setIsContextMenuOpen(true); 804 - }, 798 + isIOS 799 + ? (e) => { 800 + if (e.pointerType === 'mouse') return; 801 + // There's 'pen' too, but not sure if contextmenu event would trigger from a pen 802 + 803 + const { clientX, clientY } = e.touches?.[0] || e; 804 + // link detection copied from onContextMenu because here it works 805 + const link = e.target.closest('a'); 806 + if (link && /^https?:\/\//.test(link.getAttribute('href'))) return; 807 + e.preventDefault(); 808 + setContextMenuAnchorPoint({ 809 + x: clientX, 810 + y: clientY, 811 + }); 812 + setIsContextMenuOpen(true); 813 + } 814 + : null, 805 815 { 806 816 threshold: 600, 807 817 captureEvent: true,