Skip to content

Commit 7a6febd

Browse files
committed
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.)
1 parent 96524b4 commit 7a6febd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -578,13 +578,16 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
578578

579579
switch (action) {
580580
case (MotionEvent.ACTION_DOWN):
581-
this.getParent().requestDisallowInterceptTouchEvent(true);
581+
if (map != null && map.getUiSettings().isScrollGesturesEnabled()) {
582+
this.getParent().requestDisallowInterceptTouchEvent(true);
583+
}
582584
isTouchDown = true;
583585
break;
584586
case (MotionEvent.ACTION_MOVE):
585587
startMonitoringRegion();
586588
break;
587589
case (MotionEvent.ACTION_UP):
590+
// Clear this regardless, since isScrollGesturesEnabled() may have been updated
588591
this.getParent().requestDisallowInterceptTouchEvent(false);
589592
isTouchDown = false;
590593
break;

0 commit comments

Comments
 (0)