Skip to content

Commit

Permalink
mapbox#654 further limiting direct_select to only re-enable dragPan w…
Browse files Browse the repository at this point in the history
…hen direct_select has disabled it
  • Loading branch information
holyblader2010 authored and Zsofia Abraham committed Sep 20, 2020
1 parent aae5e89 commit cc4ba54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modes/direct_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ DirectSelect.startDragging = function(state, e) {
};

DirectSelect.stopDragging = function(state) {
if (state.initialDragPanState) {
if (state.canDragMove && state.initialDragPanState === true) {
this.map.dragPan.enable();
}
state.dragMoving = false;
Expand Down Expand Up @@ -133,7 +133,7 @@ DirectSelect.onSetup = function(opts) {
dragMoving: false,
canDragMove: false,
selectedCoordPaths: opts.coordPath ? [opts.coordPath] : [],
initialDragPanState: this.map.dragPan.isEnabled()
desiredDragPanState: null
};

this.setSelectedCoordinates(this.pathsToCoordinates(featureId, state.selectedCoordPaths));
Expand Down

0 comments on commit cc4ba54

Please sign in to comment.