Skip to content

Commit 4695254

Browse files
committed
Editor: set tabindex=-1 on all non-CM elements
1 parent f6368d2 commit 4695254

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

editor/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@
181181

182182
// Load default sketch on page load using inline JS blob
183183
window.addEventListener('load', () => {
184+
// Prevent Tab from leaving CodeMirror in Firefox
185+
setTimeout(() => {
186+
document.querySelectorAll('a, button, input, select, textarea, [tabindex]').forEach(el => {
187+
if (!el.closest('.CodeMirror')) el.setAttribute('tabindex', '-1');
188+
});
189+
}, 200);
184190
const jsBlob = URL.createObjectURL(new Blob([DEFAULT_JS], {type:'application/javascript'}));
185191
// We need the data file -- fetch it
186192
Promise.all([

0 commit comments

Comments
 (0)