Draw should not interfere with dragPan.disable()#1191
Draw should not interfere with dragPan.disable()#1191MauPalantir wants to merge 3 commits intomapbox:mainfrom
Conversation
…hen direct_select has disabled it
…hen direct_select has disabled it
| canDragMove: false, | ||
| selectedCoordPaths: opts.coordPath ? [opts.coordPath] : [] | ||
| selectedCoordPaths: opts.coordPath ? [opts.coordPath] : [], | ||
| desiredDragPanState: null |
There was a problem hiding this comment.
Nit: probably this is some leftover variable?
|
|
||
| if (ctx.options.boxSelect) { | ||
| map.boxZoom.disable(); | ||
| const dragPanState = map.dragPan.isEnabled(); |
There was a problem hiding this comment.
Nit: maybe it's worth renaming using isEnabled instead of state?
| const dragPanState = map.dragPan.isEnabled(); | |
| const dragPanIsEnabled = map.dragPan.isEnabled(); |
|
Hi @MauPalantir, thanks for the contribution! Overall this looks good to me, just a couple of nits. |
|
Done in #1216 |
|
@stepankuzmin has this fix been deployed? I am still experiencing this bug on mapbox-gl v3.7.0 and mapbox-gl-draw on v.1.4.3, which I believe are the most up to date versions? Edit: I see mapbox-gl-draw has not been released since this fix was implemented, is a release planned anytime soon? |
|
Hey @lukeMichalakisTK, thanks for the bump. This still needs to be released. |
|
@stepankuzmin No worries! We found a workaround locally that can hold us over in the meantime and I'll keep my eyes peeled for any releases from you guys, thanks! |
Fixes #654
The issue is that Draw assumes that dragPan is enabled and simply enables it without question after certain operations (when dragpan is temporarily disabled). This change would set a variable called initialDragPanState and only re-enables when it was originally enabled.