diff --git a/apps/mobile/src/components/RowPressable.tsx b/apps/mobile/src/components/RowPressable.tsx index 17f3d06599d1..bd52fbe74f11 100644 --- a/apps/mobile/src/components/RowPressable.tsx +++ b/apps/mobile/src/components/RowPressable.tsx @@ -5,7 +5,7 @@ import { GestureDetector } from "react-native-gesture-handler"; import { cn } from "../lib/cn"; import { useHoverGesture } from "../lib/useHoverGesture"; -/** Shared row feedback, layered over the background so selection stays visible. */ +/** Pointer feedback layered over selection. Touch-down may be the start of a scroll. */ export function RowPressable({ children, className, @@ -24,7 +24,7 @@ export function RowPressable({ {children} diff --git a/apps/mobile/src/lib/useHoverGesture.ts b/apps/mobile/src/lib/useHoverGesture.ts index f06e4dd54ad8..8be525c1b3c3 100644 --- a/apps/mobile/src/lib/useHoverGesture.ts +++ b/apps/mobile/src/lib/useHoverGesture.ts @@ -1,5 +1,5 @@ import { useMemo, useState } from "react"; -import { Gesture } from "react-native-gesture-handler"; +import { Gesture, PointerType } from "react-native-gesture-handler"; /** Uses native hover recognition without React Native's optional pointer-event flags. */ export function useHoverGesture(disabled = false) { @@ -12,8 +12,10 @@ export function useHoverGesture(disabled = false) { // Observe hover without competing with row taps, scrolling, or swipe actions. .cancelsTouchesInView(false) .runOnJS(true) - .onBegin(() => { - setHovered(true); + .onBegin((event) => { + setHovered( + event.pointerType === PointerType.MOUSE || event.pointerType === PointerType.STYLUS, + ); }) .onFinalize(() => { setHovered(false);