From cd09f9dfeeace894c8b5396f98aec3708e9608b0 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sun, 7 May 2017 22:44:42 -0400 Subject: [PATCH] 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.) --- modules/behavior/draw.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/behavior/draw.js b/modules/behavior/draw.js index 7549309b9..9a221e897 100644 --- a/modules/behavior/draw.js +++ b/modules/behavior/draw.js @@ -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();