Prevent an error beep when copying blocks in Safari.

This commit is contained in:
Aaron Dodson
2021-06-16 17:51:36 +00:00
parent e5a2df301a
commit 7a456a048b

View File

@@ -99,7 +99,10 @@ Blockly.ShortcutItems.registerCopy = function() {
Blockly.selected.isDeletable() &&
Blockly.selected.isMovable();
},
callback: function() {
callback: function(workspace, e) {
// Prevent the default copy behavior, which may beep or otherwise indicate
// an error due to the lack of a selection.
e.preventDefault();
Blockly.hideChaff();
Blockly.copy(/** @type {!Blockly.ICopyable} */ (Blockly.selected));
return true;