Skip to content

Commit

Permalink
Merge pull request #9618 from keymanapp/fix/web/toolbar-keyboard-chan…
Browse files Browse the repository at this point in the history
…ge-refocus

fix(web): fixes toolbar refocus timing after a keyboard change
  • Loading branch information
jahorton authored Oct 2, 2023
2 parents d2ed4c1 + 87d1a44 commit 966e5db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/src/app/ui/kmwuitoolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,12 @@ if(!keyman?.ui?.name) {
this.selectedLanguage = kbd.LanguageCode;

// Return focus to input area and activate the selected keyboard
this.setLastFocus(); //*****this seems out of sequence???
this.addKeyboardToList(lang, kbd);
if(updateKeyman) {
keymanweb.setActiveKeyboard(kbd.InternalName, kbd.LanguageCode);
keymanweb.setActiveKeyboard(kbd.InternalName, kbd.LanguageCode).then(() => {
// Restore focus _after_ the keyboard finishes loading.
this.setLastFocus();
});
}
this.listedKeyboards[this.findListedKeyboard(lang)].buttonNode.className = 'kmw_button_selected';

Expand Down

0 comments on commit 966e5db

Please sign in to comment.