Skip to content

fix(ios): fix Images consuming gestures - #4277

Open
fractalbeauty wants to merge 1 commit into
rnmapbox:mainfrom
wanderlog:hazel/images-hit-test
Open

fix(ios): fix Images consuming gestures#4277
fractalbeauty wants to merge 1 commit into
rnmapbox:mainfrom
wanderlog:hazel/images-hit-test

Conversation

@fractalbeauty

Copy link
Copy Markdown

Description

Fixes <Images> sometimes consuming gestures on iOS by ignoring hit-testing on RNMBXImages. This prevented gestures from reaching the map (pan/zoom/rotate gestures did not start) or markers (press events did not fire). As far as I can tell, children of <Images> never need to be interactable (they're used for rendering reusable marker images), so this is correct.

We found this bug in our app which uses v10.2.10 and the old architecture. We use ShapeSource/SymbolLayer with an Images component which has React Native views as its children (not fixed image assets).

The root cause was confirmed by listening to all gestures in the native code and logging the hit-tested views. Successful gestures showed MapView -> RNMBXMapView -> RCTView. Failed gestures showed RNMBXImage -> RNMBXImages -> RNMBXMapView -> RCTView. This didn't happen all the time (some gestures worked), but I'm not sure what the trigger was.

I tried to reproduce this in the example app but wasn't able to. My guesses are:

  • We have a different view setup from the ShapeSource example
  • We have a pressable view somewhere in Images

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

@fractalbeauty
fractalbeauty requested a deployment to CI with Mapbox Tokens August 6, 2026 16:59 — with GitHub Actions Waiting
@fractalbeauty
fractalbeauty requested a deployment to CI with Mapbox Tokens August 6, 2026 16:59 — with GitHub Actions Waiting
@fractalbeauty
fractalbeauty requested a deployment to CI with Mapbox Tokens August 6, 2026 16:59 — with GitHub Actions Waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant