Skip to content

Commit 2499f55

Browse files
mikelambertfelipecsl
authored andcommitted
If we've disabled scrolling within the map, then don't capture the touch events (#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
1 parent c1a30fe commit 2499f55

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

android/src/main/java/com/airbnb/android/react/maps/AirMapView.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,15 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
571571

572572
switch (action) {
573573
case (MotionEvent.ACTION_DOWN):
574-
this.getParent().requestDisallowInterceptTouchEvent(true);
574+
this.getParent().requestDisallowInterceptTouchEvent(
575+
map != null && map.getUiSettings().isScrollGesturesEnabled());
575576
isTouchDown = true;
576577
break;
577578
case (MotionEvent.ACTION_MOVE):
578579
startMonitoringRegion();
579580
break;
580581
case (MotionEvent.ACTION_UP):
582+
// Clear this regardless, since isScrollGesturesEnabled() may have been updated
581583
this.getParent().requestDisallowInterceptTouchEvent(false);
582584
isTouchDown = false;
583585
break;

0 commit comments

Comments
 (0)