Skip to content

Commit 0223b79

Browse files
committed
Editor: capture Tab in capture phase for Firefox
1 parent 0f6c057 commit 0223b79

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

editor/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,17 @@
238238

239239
document.addEventListener('keydown', e => {
240240
if ((e.ctrlKey||e.metaKey) && e.key==='Enter') { e.preventDefault(); runSketch(); }
241+
}, false);
242+
document.addEventListener('keydown', e => {
241243
if (e.key === 'Tab') {
242244
const cm = document.querySelector('.CodeMirror');
243245
if (cm && cm.contains(document.activeElement)) {
244246
e.preventDefault();
247+
e.stopImmediatePropagation();
248+
editor.execCommand('indentMore');
245249
}
246250
}
247-
});
251+
}, true);
248252
</script>
249253
</div>
250254
</div>

0 commit comments

Comments
 (0)