From b686fe6170aaee198cdbf92b249cf8156eca8ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Harald=20S=C3=B8by?= Date: Fri, 25 Aug 2023 15:29:49 +0200 Subject: [PATCH] Focus ULS button when the language menu is closed with Escape (#468) Before this, the focus would return to the 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 --- src/jquery.uls.core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index 15c37b76..58d23466 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -328,6 +328,7 @@ if ( e.keyCode === 27 ) { // escape this.cancel(); + this.$element.focus(); e.preventDefault(); e.stopPropagation(); }