Skip to content

Commit cd30bfe

Browse files
microbit-markmicrobit-carlos
authored andcommitted
A11y: Fix pressing esc on editor to focus flash button in webUSB mode (#315)
1 parent 0270cf7 commit cd30bfe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python-main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,12 @@ function web_editor(config) {
590590
// Bind the ESCAPE key.
591591
$(document).keyup(function(e) {
592592
if (e.keyCode == 27) { // ESCAPE
593-
$('#command-download').focus();
593+
if ( $('#command-download').is(':visible') ) {
594+
$('#command-download').focus();
595+
}
596+
else if ( $('#command-flash').is(':visible') ){
597+
$('#command-flash').focus();
598+
}
594599
}
595600
});
596601
// Bind drag and drop into editor.

0 commit comments

Comments
 (0)