Skip to content

Commit 5b1a07c

Browse files
authored
fix: Don't listen for shortcuts on the document. (#2609)
1 parent a794258 commit 5b1a07c

File tree

1 file changed

+2
-12
lines changed
  • plugins/dev-tools/src/playground

1 file changed

+2
-12
lines changed

plugins/dev-tools/src/playground/index.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ function registerEditorCommands(editor, playground) {
594594
try {
595595
Blockly.serialization.workspaces.load(JSON.parse(json), workspace);
596596
} catch (e) {
597-
// If this fails that's fine.
598-
return false;
597+
// If this fails fall back to trying to load XML instead.
598+
return loadXml();
599599
}
600600
return true;
601601
};
@@ -661,14 +661,4 @@ function registerEditorCommands(editor, playground) {
661661
contextMenuOrder: 1,
662662
run: save,
663663
});
664-
document.addEventListener('keydown', (e) => {
665-
const ctrlCmd = e.metaKey || e.ctrlKey;
666-
if (ctrlCmd && e.key === 's') {
667-
save();
668-
e.preventDefault();
669-
} else if (ctrlCmd && e.key === 'Enter') {
670-
if (!loadJson()) loadXml();
671-
e.preventDefault();
672-
}
673-
});
674664
}

0 commit comments

Comments
 (0)