Skip to content

Commit

Permalink
If we've disabled scrolling within the map, then don't capture the to…
Browse files Browse the repository at this point in the history
…uch events (react-native-maps#664)

* If we've disabled scrolling within the map, then don't capture the touch events. This allows the containing scrollview to perform a scrollview scroll by dragging on the map. (Previously, the map would absorb the touches, and then not scroll the map *or* the scrollview, which was bad.)

* Minor simplification
  • Loading branch information
mikelambert authored and felipecsl committed Oct 31, 2016
1 parent c1a30fe commit 2499f55
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,15 @@ public boolean dispatchTouchEvent(MotionEvent ev) {

switch (action) {
case (MotionEvent.ACTION_DOWN):
this.getParent().requestDisallowInterceptTouchEvent(true);
this.getParent().requestDisallowInterceptTouchEvent(
map != null && map.getUiSettings().isScrollGesturesEnabled());
isTouchDown = true;
break;
case (MotionEvent.ACTION_MOVE):
startMonitoringRegion();
break;
case (MotionEvent.ACTION_UP):
// Clear this regardless, since isScrollGesturesEnabled() may have been updated
this.getParent().requestDisallowInterceptTouchEvent(false);
isTouchDown = false;
break;
Expand Down

0 comments on commit 2499f55

Please sign in to comment.