fix(mobile): preserve song context menus during press handling

This commit is contained in:
joshuafhiggins committed 2026-11-15 10:46:03 -05:00 Verified
1 parent 3765789b10
commit eae52548f1
1 file changed
+8 -8
+8 -8
View File
@@ -7,6 +7,8 @@ import {
const TAP_DISTANCE = 10
function consumeLongPress() {}
type SongPressableProps = Omit<PressableProps, "onPress"> & {
onPress?: () => void
}
@@ -30,18 +32,16 @@ export function SongPressable({ onPress, ...props }: SongPressableProps) {
<Pressable
{...props}
onAccessibilityTap={props.onAccessibilityTap ?? onPress}
onTouchStart={(event) => {
// Let UIKit present the context menu without playing on release.
onLongPress={props.onLongPress ?? consumeLongPress}
onPressIn={(event) => {
const { pageX, pageY } = event.nativeEvent
touch.current = { x: pageX, y: pageY, cancelled: false }
props.onTouchStart?.(event)
props.onPressIn?.(event)
}}
onTouchMove={(event) => {
onPressMove={(event) => {
checkMovement(event)
props.onTouchMove?.(event)
}}
onTouchCancel={(event) => {
if (touch.current) touch.current.cancelled = true
props.onTouchCancel?.(event)
props.onPressMove?.(event)
}}
onPress={(event) => {
checkMovement(event)