Focus ULS button when the language menu is closed with Escape (#468)

Before this, the focus would return to the <body> element (i.e. at
the very top of the document) when you hit the Escape key, instead
of the ULS button, so if you were navigating with the keyboard, you
would have to tab through all preceding focusable elements before
you got back to the language button (and beyond).

Bug: https://phabricator.wikimedia.org/T325009
This commit is contained in:
Jon Harald Søby
2023-08-25 15:29:49 +02:00
committed by GitHub
parent e19b05bc50
commit b686fe6170

View File

@@ -328,6 +328,7 @@
if ( e.keyCode === 27 ) { // escape if ( e.keyCode === 27 ) { // escape
this.cancel(); this.cancel();
this.$element.focus();
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
} }