mirror of https://github.com/zulip/zulip.git
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:
parent
ae613c815e
commit
866c91d5a5
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue