diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index af9e1fb8..49e7abfc 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -8,7 +8,6 @@ Please see LICENSE in the repository root for full details. import { type MatrixClient, type Room as MatrixRoom } from "matrix-js-sdk"; import { type FC, - type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, useCallback, useEffect, @@ -278,10 +277,13 @@ export const InCallView: FC = ({ } }, [ringing, latestPickupPhaseAudio]); - const onViewClick = useCallback( - (e: ReactMouseEvent) => { + // iOS Safari doesn't reliably fire `click` on plain
s, so we listen + // for `pointerup` instead. Scrolls end in `pointercancel`, not `pointerup`, + // so this still only fires for taps. + const onViewPointerUp = useCallback( + (e: ReactPointerEvent) => { if ( - (e.nativeEvent as PointerEvent).pointerType === "touch" && + e.pointerType === "touch" && // If an interactive element was tapped, don't count this as a tap on the screen (e.target as Element).closest?.("button, input") === null ) @@ -611,13 +613,13 @@ export const InCallView: FC = ({ const allConnections = useBehavior(vm.allConnections$); return ( - // The onClick handler here exists to control the visibility of the footer, + // The pointer handler here exists to control the visibility of the footer, // and the footer is also viewable by moving focus into it, so this is fine. - // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events + // eslint-disable-next-line jsx-a11y/no-static-element-interactions