-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draw should not interfere with dragPan.disable() #1191
Conversation
…hen direct_select has disabled it
…hen direct_select has disabled it
@@ -128,7 +132,8 @@ DirectSelect.onSetup = function(opts) { | |||
dragMoveLocation: opts.startPos || null, | |||
dragMoving: false, | |||
canDragMove: false, | |||
selectedCoordPaths: opts.coordPath ? [opts.coordPath] : [] | |||
selectedCoordPaths: opts.coordPath ? [opts.coordPath] : [], | |||
desiredDragPanState: null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: probably this is some leftover variable?
@@ -64,10 +64,14 @@ export default function(ctx) { | |||
|
|||
if (ctx.options.boxSelect) { | |||
map.boxZoom.disable(); | |||
const dragPanState = map.dragPan.isEnabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.