From a51e93280082458dcc90b80aaf7e7f77944b33ca Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 31 May 2013 14:29:57 -0700 Subject: [PATCH] =?UTF-8?q?Do=20preventDefault=20behavior=20on=20=E2=8C=98?= =?UTF-8?q?Z=20and=20=E2=8C=98=E2=87=A7Z?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prevents some instances of https://bugs.webkit.org/show_bug.cgi?id=117092, and generally we don't ever want the default undo behavior when these handlers are triggered. --- js/id/ui/undo_redo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/id/ui/undo_redo.js b/js/id/ui/undo_redo.js index 52edf7f79..83c375f18 100644 --- a/js/id/ui/undo_redo.js +++ b/js/id/ui/undo_redo.js @@ -30,8 +30,8 @@ iD.ui.UndoRedo = function(context) { .attr('class', function(d) { return 'icon ' + d.id; }); var keybinding = d3.keybinding('undo') - .on(commands[0].cmd, commands[0].action) - .on(commands[1].cmd, commands[1].action); + .on(commands[0].cmd, function() { d3.event.preventDefault(); commands[0].action(); }) + .on(commands[1].cmd, function() { d3.event.preventDefault(); commands[1].action(); }); d3.select(document) .call(keybinding);