Skip to content

🐛 Touch events blocked by Camera view (buttons require double tap to work) #3533

Open
@Semiteplov

Description

@Semiteplov

What's happening?

When placing interactive elements (e.g., buttons) on top of the Camera component, touch events are partially blocked. Buttons often require two taps to trigger onPress, even with:

pointerEvents="box-none"
zIndex adjustments
enableZoomGesture={false}

Reproduceable Code

const device = useCameraDevice('back');
if (!device) return <View />;

return (
  <View style={StyleSheet.absoluteFill}>
    <Camera
      device={device}
      isActive={true}
      style={StyleSheet.absoluteFill}
      enableZoomGesture={false}
    />
    <View style={{ position: 'absolute', top: 100, left: 20 }}>
      <Button title="Back" onPress={() => console.log('Pressed!')} />
    </View>
  </View>
);

Relevant log output

I  Camera State: OPEN (has error: false)
I  invokeOnStarted()
D  All use case: [androidx.camera.core.Preview-676386c2-7de4-45ac-846b-111f77f8d1ab266175590] for camera: 10
D  Active and attached use case: [androidx.camera.core.Preview-676386c2-7de4-45ac-846b-111f77f8d1ab266175590] for camera: 10
I  Preview orientation changed! PORTRAIT
I  invokeOnPreviewOrientationChanged(PORTRAIT)
I  Output orientation changed! PORTRAIT
I  invokeOnOutputOrientationChanged(PORTRAIT)
I  Camera #10 is now unavailable.
W  disableBackButtonMenu prop is not available on Android
W  largeTitleHideShadow prop is not available on Android
W  backTitle prop is not available on Android
I  CameraView attached to window!

Camera Device

{
  "formats": [],
  "sensorOrientation": "landscape-left",
  "hardwareLevel": "limited",
  "maxZoom": 1,
  "minZoom": 1,
  "maxExposure": 6,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "ultra-wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "isMultiCam": false,
  "minFocusDistance": 0,
  "minExposure": -6,
  "name": "10 (BACK) androidx.camera.camera2",
  "hasFlash": false,
  "hasTorch": false,
  "position": "back",
  "id": "10"
}

Device

Android emulator Pixel 9 Android 16.0

VisionCamera Version

4.3.1 and 4.6.4

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions