fix(MarkerView): forward pointerEvents prop to native view#4232
Open
mfazekas wants to merge 3 commits into
Open
fix(MarkerView): forward pointerEvents prop to native view#4232mfazekas wants to merge 3 commits into
mfazekas wants to merge 3 commits into
Conversation
added 3 commits
June 21, 2026 16:02
MarkerView accepted pointerEvents via ViewProps but never destructured or passed it to the native RNMBXMarkerView, so pointerEvents="none" had no effect. Also skip stopPropagation in onTouchEnd when pointerEvents is "none" or "box-none" so JS-level event handling stays consistent. Fixes #4219
…ntent RNMBXMarkerViewContent is added directly to Mapbox's ViewAnnotationManager (separate from RN's view hierarchy), so setting pointerEvents on the parent RNMBXMarkerView via Fabric had no effect on touch handling of the content view. Override setPointerEvents in RNMBXMarkerView to propagate the value to the content view. In RNMBXMarkerViewContent.dispatchTouchEvent, return false early when pointerEvents=NONE so touches fall through to the map.
Fabric's codegen delegate (RNMBXMarkerViewManagerDelegate) does not forward the standard pointerEvents ViewProp, so setPointerEvents on RNMBXMarkerView was never called. Override updateProperties in the ViewManager to read the prop from ReactStylesDiffMap and push it to RNMBXMarkerViewContent via setContentPointerEvents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4219.
MarkerViewacceptedpointerEventsviaViewPropsbut never forwarded it to native, sopointerEvents="none"had no effect — the marker kept intercepting touches regardless.iOS: Destructure
pointerEventsfrom props and pass it to the nativeRNMBXMarkerView. SkipstopPropagationinonTouchEndwhenpointerEventsis"none"or"box-none"for consistent JS event handling.Android:
RNMBXMarkerViewContentis added directly to Mapbox'sViewAnnotationManager(outside RN's view hierarchy), so Fabric's normalpointerEventspropagation doesn't reach it. OverridesetPointerEventsinRNMBXMarkerViewto propagate the value, and inRNMBXMarkerViewContent.dispatchTouchEventreturnfalseearly whenpointerEvents=NONE(also skipping therequestDisallowInterceptTouchEventcall that would otherwise keep the map from receiving touches).Also updates the Marker View example to add a toggle for
pointerEventsso the behavior can be verified interactively.Repro
With this fix,
pointerEvents="none"makes the marker transparent to all touch events, passing them through to the map below.