Skip to content
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

Boxselector move box is breaking pointselector when clicked inside the box. #3

Closed
tpotter7 opened this issue May 26, 2019 · 2 comments

Comments

@tpotter7
Copy link
Collaborator

When I click inside of a box (to set center in tilemill for example), the new boxselector functionality that lets me drag the box around is breaking the pointselector functionality.

tpotter7 added a commit that referenced this issue May 26, 2019
…icks inside of the box and also allowing the box move functionality at the same time.
@tpotter7
Copy link
Collaborator Author

What is happening in this one is that the boxselector mouseDown is canceling event propagation at the end of mouseDown if they clicked inside the box. This causes pointselector mouseDown to not get called and therefore not setup pointselector functionality (setting up mouseUp handler and saving mouseDownPoint). But, if we don't cancel event propagation at the end of boxselector mouseDown, then the map move (mm.DragHandler) functionality gets setup in it's mouseDown. Later, when the box is dragged, the map is also dragged. But, we only want the box to be dragged! This is happening even though boxselector mouseMove is canceling event propagation. Yet, mm.DragHandler mouseMove is still being called. Don't know why this event propagation cancel is not working. The only difference that I see is that the mouseMove event handlers are on the document rather than on the map.parent or boxDiv. I wonder what would happen if we move mouse move to be on map.parent and boxDiv and just leave mouseUp to be on document? Seems like there is not much value in moving beyond the element of interest.

@tpotter7
Copy link
Collaborator Author

In the meantime, I have created a bit of a hack (marked "HACK1" in the code) that seems to work around this problem. But, I'd like to figure out a more appropriate fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant