Prevent mouseup from turning into a click

Mouseup was turning into a click on whatever was the last thing clicked.
In this walkthrough, this would sometimes be the "Add Area" mode button,
which would re-enter the add area mode and throw away the user's drawing.
(I have no idea why.)
This commit is contained in:
Bryan Housel
2017-05-07 22:44:42 -04:00
parent 2c2a0bb533
commit cd09f9dfee

View File

@@ -141,6 +141,8 @@ export function behaviorDraw(context) {
d3.select(window).on('keyup.space-block', function() {
disableSpace = false;
d3.select(window).on('keyup.space-block', null);
d3.event.preventDefault();
d3.event.stopPropagation();
});
d3.event.preventDefault();