info_overlay: Fix initial keyboard focus in keyboard shortcuts help.

The core bug here was that we opened the overlay after setting up the toggler
widget; this meant that the call to focus the correct element in the toggler 
widget setup code path was ignored due to it not being possible to focus an
element that is hidden.

Fix this bug by reordering the execution of things, now we first open
the overlay to make sure that the content is available to be focused when
setting up the toggler.
This commit is contained in:
Lalit 2023-04-27 23:04:18 +05:30 committed by GitHub
parent ae613c815e
commit 866c91d5a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -257,10 +257,6 @@ export function set_up_toggler() {
}
export function show(target) {
if (!toggler) {
set_up_toggler();
}
const $overlay = $(".informational-overlays");
if (!$overlay.hasClass("show")) {
@ -273,6 +269,10 @@ export function show(target) {
});
}
if (!toggler) {
set_up_toggler();
}
if (target) {
toggler.goto(target);
}