Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop marker event propagation in order to prevent onPress for MapView… #2068

Merged
merged 2 commits into from Mar 10, 2018

Conversation

Projects
None yet
3 participants
@hysan
Copy link
Contributor

hysan commented Mar 7, 2018

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

Stop marker event propagation in order to prevent onPress for MapView…
…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 #1132.
@rborn

This comment has been minimized.

Copy link
Collaborator

rborn commented Mar 8, 2018

LGTM @alvelig 🐽

@alvelig

This comment has been minimized.

Copy link
Collaborator

alvelig commented Mar 8, 2018

@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 stopPropagation={true}.

@hysan

This comment has been minimized.

Copy link
Contributor Author

hysan commented Mar 8, 2018

@alvelig Ok, so add a stopPropagation prop and default it to false + update the Marker docs? How much explanation should I put into the docs?

@alvelig

This comment has been minimized.

Copy link
Collaborator

alvelig commented Mar 8, 2018

As much as you wish. You may just reference your comment in the issue with short comments. That will do.

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.
@hysan

This comment has been minimized.

Copy link
Contributor Author

hysan commented Mar 9, 2018

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.

@alvelig

This comment has been minimized.

Copy link
Collaborator

alvelig commented Mar 9, 2018

LGTM

@rborn rborn merged commit f8e9253 into react-native-community:master Mar 10, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.