Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

a11y: remove tabindex and allow escaping codemirror #168

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/CodeMirror.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
readOnly: readonly,
autoCloseBrackets: true,
autoCloseTags: true,
extraKeys: {
extraKeys: CodeMirror.normalizeKeyMap({
'Enter': 'newlineAndIndentContinueMarkdownList',
'Ctrl-/': 'toggleComment',
'Cmd-/': 'toggleComment',
Expand All @@ -181,8 +181,10 @@
},
'Cmd-Q': function (cm) {
cm.foldCode(cm.getCursor());
}
},
},
// allow escaping the CodeMirror with Esc Tab
'Esc Tab': false
}),
foldGutter: true,
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter']
};
Expand Down Expand Up @@ -287,9 +289,7 @@
</style>

<div class='codemirror-container' class:flex bind:offsetWidth={w} bind:offsetHeight={h}>
<!-- svelte-ignore a11y-positive-tabindex -->
<textarea
tabindex='2'
bind:this={refs.editor}
readonly
value={code}
Expand Down
5 changes: 2 additions & 3 deletions src/Output/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,12 @@
position: absolute;
width: 100%;
height: calc(100% - 42px) !important;
opacity: 0;
visibility: hidden;
pointer-events: none;
}

.tab-content.visible {
/* can't use visibility due to a weird painting bug in Chrome */
opacity: 1;
visibility: visible;
pointer-events: all;
}
iframe {
Expand Down