Stop marker event propagation in order to prevent onPress for MapView…#2068
Merged
rborn merged 2 commits intoreact-native-maps:masterfrom Mar 10, 2018
Merged
Stop marker event propagation in order to prevent onPress for MapView…#2068rborn merged 2 commits intoreact-native-maps:masterfrom
rborn merged 2 commits intoreact-native-maps:masterfrom
Conversation
…s from being called when a marker is clicked. This makes the behavior of Apple Maps identical to that of the behavior of Google Maps on Android. This fixes react-native-maps#1132.
Collaborator
|
LGTM @alvelig 🐽 |
Contributor
|
@hysan you yourself say that it would be a switchable adjustment with a prop... Let's be consistent for this behavior and I suggest keeping propagation by default but make it configurable with a prop |
Contributor
Author
|
@alvelig Ok, so add a |
Contributor
|
As much as you wish. You may just reference your comment in the issue with short comments. That will do. |
…to control whether or not onPress events from Markers propagate up and trigger MapView onPress events. This is iOS only. The default behavior is disabled (false) to prevent a breaking change from the current behavior.
Contributor
Author
|
Done, but I'm not familiar with TypeScript so all I did was copy paste. Also, I could have not defined defaultProps and just relied on undefined being falsy, but I wasn't sure if that was idiomatic or not. Someone should double check. Thanks. |
Contributor
|
LGTM |
pinpong
pushed a commit
to pinpong/react-native-maps
that referenced
this pull request
Feb 28, 2025
react-native-maps#2068) * Stop marker event propagation in order to prevent onPress for MapViews from being called when a marker is clicked. This makes the behavior of Apple Maps identical to that of the behavior of Google Maps on Android. This fixes react-native-maps#1132. * Added a new Marker prop called stopPropagation. This allows the user to control whether or not onPress events from Markers propagate up and trigger MapView onPress events. This is iOS only. The default behavior is disabled (false) to prevent a breaking change from the current behavior.
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.
Stop marker event propagation in order to prevent onPress for MapViews from being called when a marker is clicked. This makes the behavior of Apple Maps identical to that of the behavior of Google Maps on Android. This fixes #1132.
Is there any other PR opened that does the same ?
No, not that I've seen. Nothing is referenced in any of the issues I've come across either.
What issue is this PR fixing
#1132