There was an error while loading. Please reload this page.
1 parent 2b3eb75 commit ac1b175Copy full SHA for ac1b175
1 file changed
editor/index.html
@@ -241,16 +241,18 @@
241
});
242
243
// Fix Tab in Firefox: intercept on the CM textarea directly
244
-const cmTextarea = document.querySelector('.CodeMirror textarea');
245
-if (cmTextarea) {
246
- cmTextarea.addEventListener('keydown', e => {
247
- if (e.key === 'Tab') {
248
- e.preventDefault();
249
- e.stopPropagation();
250
- editor.replaceSelection(' ');
251
- }
252
- }, true);
253
-}
+setTimeout(() => {
+ const cmTextarea = document.querySelector('.CodeMirror textarea');
+ if (cmTextarea) {
+ cmTextarea.addEventListener('keydown', e => {
+ if (e.key === 'Tab') {
+ e.preventDefault();
+ e.stopPropagation();
+ editor.replaceSelection(' ');
+ }
+ }, true);
254
255
+}, 100);
256
</script>
257
</div>
258
0 commit comments