pmndrs/react-three-fiber

onPointerMissed is never called in react-native

krzys-h opened this issue · 2 comments

Similar story to #3315 - the code attempts to access e.offsetX here:
https://github.com/pmndrs/react-three-fiber/blob/v8.16.8/packages/fiber/src/core/events.ts#L175-L176
which does not exist on react-native events.

This in turn causes the calculateDistance calculation to always return NaN and if (delta <= 2) to never match.

Is there any update about this?
I can fix it

cc: @CodyJasonBennett

No, generally updates occur naturally in their pertinent issues; you don't have to ping me for an update.

I'm not sure this is exactly true of a diagnosis, or perhaps we're not mutating the right reference here.

function handleTouch(gestureEvent: GestureResponderEvent, type: string): true {
gestureEvent.persist()
canvas.dispatchEvent(
Object.assign(gestureEvent.nativeEvent, {
type,
offsetX: gestureEvent.nativeEvent.locationX,
offsetY: gestureEvent.nativeEvent.locationY,
pointerType: 'touch',
}) as unknown as Event,
)
return true
}